[BioPython] GenBank parsing

Kyle Dent clayton_kd at yahoo.com
Tue May 2 07:47:35 UTC 2006


Hey Peter,

Thanks for the help, that updated managed to solve a
separate problem I encountered with a genbank file I
downloaded in December. 

Unfortunately my existing problem stands. Here is the
latest complaint (curtosy of the revised parser):

Traceback (most recent call last):
  File "C:\blast\bin\script.py", line 21, in ?
    cur_record = gb_iterator.next()
  File
"C:\Python24\Lib\site-packages\Bio\GenBank\__init__.py",
line 146, in next
    return self._parser.parse(File.StringHandle(data))
  File
"C:\Python24\Lib\site-packages\Bio\GenBank\__init__.py",
line 191, in parse
    self._scanner.feed(handle, self._consumer)
  File
"C:\Python24\Lib\site-packages\Bio\GenBank\__init__.py",
line 1541, in feed
    line = self._feed_header(handle, consumer)
  File
"C:\Python24\Lib\site-packages\Bio\GenBank\__init__.py",
line 1507, in _feed_header
    getattr(consumer,
self._consumer_dict[line_type])(data)
  File
"C:\Python24\Lib\site-packages\Bio\GenBank\__init__.py",
line 511, in title
    self._current_ref.title = content
AttributeError: 'NoneType' object has no attribute
'title'

I had examined the difference between Genbank files
downloaded recently with those I downloaded in the
past (its been a few months since Ive had to work with
this). The major difference is a TITLE field which
adjacent to the ACCESSION field. BioEdit seems to add
these title fields as well, hence my not being able to
parse BioEdited genbank files either.

Help with this would be greatly appreciated,

Regards,

--- "Peter (BioPython)"
<biopython at maubp.freeserve.co.uk> wrote:

> Kyle Dent wrote:
> > Dear All,
> > 
> > My script was successfully implementing the
> Genbank
> > parser until just today I was trying to get it to
> > parse a genpept file. After much experimentation I
> > discovered that it was actually having trouble
> parsing
> > even newly downloaded GenBank files as well
> > (downloaded of NCBI).
> > 
> > I wanted to ask if anyone is aware of this
> problem, I
> > understand the flat file format was updated this
> month
> > and is probably the cause of this.
> 
> I'm aware that earlier in 2006, there was a new
> project line added.  I 
> haven't been aware of any further changes... on the
> other hand, I don't 
> think I've ever used a "genpept" file either.
> 
> Anyway, from the error message you are using the
> "old" Martel based 
> parser shipped with BioPython 1.41
> 
> We recommend you update to the current CVS parser
> which is (a) more up 
> to date, (b) faster, (c) should give slightly more
> helpful error 
> messages if it does get stuck.
> 
> For most cases you can simply download this file,
> replacing your 
> Bio/GenBank/__init__.py after making a backup of the
> old version:
> 
>
http://cvs.biopython.org/cgi-bin/viewcvs/viewcvs.cgi/biopython/Bio/GenBank/__init__.py?cvsroot=biopython
> 
> If you see errors about ReseekFile then you will
> need to make a few 
> other changes...
> 
> If you are still having trouble, or need further
> help making the update, 
> please reply back.  Including the GenBank reference
> of any problem file 
> would be handy.
> 
> Thank you
> 
> Peter
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Biopython mailing list