Question: Bio.Genbank.Locationparsererror
gravatar for User 6115
9.8 years ago by
User 611520
User 611520 wrote:

Hi all,

I'm scanning through all of GenBank's bacterial genomes using biopython.

I've been getting an occasional error recently parsing location data. Specifically:

  File "/usr/lib/pymodules/python2.7/Bio/SeqIO/", line 525, in parse
    for r in i:
  File "/usr/lib/pymodules/python2.7/Bio/GenBank/", line 437, in parserecords
    record = self.parse(handle, dofeatures)
  File "/usr/lib/pymodules/python2.7/Bio/GenBank/", line 420, in parse
    if self.feed(handle, consumer, dofeatures):
  File "/usr/lib/pymodules/python2.7/Bio/GenBank/", line 392, in feed
    self.feedfeaturetable(consumer, self.parsefeatures(skip=False))
  File "/usr/lib/pymodules/python2.7/Bio/GenBank/", line 344, in _feedfeaturetable
  File "/usr/lib/pymodules/python2.7/Bio/GenBank/", line 975, in location
    raise LocationParserError(location_line)
  Bio.GenBank.LocationParserError: order(join(649703..649712,649751..649752),650047..650049)

My code is a simple loop through all filenames I feed in at the command line:


            contig = SeqIO.parse(open(gb_file,"r"), "genbank")
            sys.stderr.write("ERROR: Parsing gbk file "+gb_file+"!\n")
        sys.stderr.write("Loading genome " + str(counter) + " of "+str(len(sys.argv)-1)+" ("+gb_file+")\n")

        for gb_record in contig:


This is in the Aeropyrum pernix K1 genome, NC_000854.gbk. I don't see anything wrong with the location data. Can anyone help?

Thanks, -Morgan

biopython • 2.2k views
ADD COMMENTlink written 9.8 years ago by User 611520
gravatar for Brad Chapman
9.8 years ago by
Brad Chapman9.5k
Boston, MA
Brad Chapman9.5k wrote:

This looks like a case of the issue discussed here:

Where order and join are combined in a single location:


According to the GenBank specification this should not be allowed.

Peter posted a fix in that discussion, but decided not to check it in as the files in question were identified as problematic by NCBI. You can try Peter's fix if you just need to get through these. As a more permanent solution, you should e-mail NCBI and get clarification on if this is allowed or will be fixed. If these are reported as valid then please do reopen that bug discussion and lobby for including a more permanent change.

ADD COMMENTlink modified 17 months ago by Ram32k • written 9.8 years ago by Brad Chapman9.5k

I noted this on the Biopython bug report, and emailed the NCBI.

ADD REPLYlink written 9.8 years ago by Peter5.9k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2051 users visited in the last hour