[Biopython] SeqIO.index AttributeError: 'SeqRecord' object has no attribute 'taxonomy'

Sheila the angel from.d.putto at gmail.com
Mon Nov 7 19:10:22 UTC 2011


Hi All,
Consider the following code (from Biopython Cookbook)

from Bio import SeqIO
uniprot = SeqIO.index("uniprot_sprot.dat", "swiss")
handle = open("selected.dat", "w")
for acc in ["P33487", "P19801", "P13689", "Q8JZQ5", "Q9TRC7"]:
    handle.write(uniprot.get_raw(acc))
handle.close()

I want to print only selected part of  (ID, description and Taxonomy ) not
the full record. I modified the code as

for acc in ["P33487", "P19801", "P13689", "Q8JZQ5", "Q9TRC7"]:
     print uniprot[acc].id, uniprot[acc].description, uniprot[acc].taxonomy

but this gives error "AttributeError: 'SeqRecord' object has no attribute
'taxonomy' "
Any suggestion !!!!

--
Sheila d angel



More information about the Biopython mailing list