[Biopython] error in parseing Gene bank
Peter Cock
p.j.a.cock at googlemail.com
Wed Oct 3 14:35:46 UTC 2012
On Wed, Oct 3, 2012 at 3:18 PM, francesco chiani
<francesco.chiani at gmail.com> wrote:
> Hi Everyone,
> Someone have an idea of why in biopython for python 2.7 give me this error
> while parsing a gene bank file?
>
>
> Traceback (most recent call last):
> in <module>
> for seq_record in SeqIO.parse(handle, "genbank"):
> File "C:\Python27\lib\site-packages\Bio\SeqIO\__init__.py", line 537, in parse
> for r in i:
> File "C:\Python27\lib\site-packages\Bio\GenBank\Scanner.py", line 445, in
> parse_records
> record = self.parse(handle, do_features)
> File "C:\Python27\lib\site-packages\Bio\GenBank\Scanner.py", line 428, in parse
> if self.feed(handle, consumer, do_features):
> File "C:\Python27\lib\site-packages\Bio\GenBank\Scanner.py", line 410, in feed
> consumer.record_end("//")
> File "C:\Python27\lib\site-packages\Bio\GenBank\__init__.py", line 1184, in
> record_end
> % self._seq_type)
> ValueError: Could not determine alphabet for seq_type dna
>
> p.s.-:This doesn't happen in biopython for python 2.6 version I suppose, 'cause
> with the same gene bank file in this version my script works...
>
>
> thanks x your help,
> F.
If you've switched from Python 2.6 to Python 2.7, it is likely
you've also got a more recent Biopython on the Python 2.7
installation. Could you check the two Biopython versions?
The problem is most likely an invalid LOCUS line (which
should indicate if the sequence is DNA/Protein etc).
Could you show us the first few lines of the GenBank file?
Thanks,
Peter
More information about the Biopython
mailing list