How do I get SeqIO.write() to make a genbank file that includes the REFERENCE field?
Entering edit mode
8.3 years ago
Tom ▴ 20

As I have it set up right now, Seq.IO.write(mygenbankObject, outfileHandle, genbank) seems to just write the LOCUS field, and the FEATURES field, but leaves everything else blank. It doesn't include the REFERENCE, which is what I need my final .gb file to have.

(Additionally, I don't even know what to call the titles that are in big capital letters in a genbank file. What's the technical term for the category that is: LOCUS, ORGANISM, REFERENCE, AUTHORS, FEATURES, etc...?)

Edit: I just found out those fields are called keys:

>>> record.annotations.keys()
['comment', 'sequence_version', 'source', 'taxonomy', 'keywords', 'references',
'accessions', 'data_file_division', 'date', 'organism', 'gi']

Now if only I can get the reference region

genbank python SeqIO biopython • 2.2k views
Entering edit mode
8.2 years ago
Peter 6.0k

If you are creating the SeqRecord object yourself in code (rather than using the Biopython parser), you will need to create a list of Bio.SeqFeature.Reference objects as the record.annotations["references"] entry.

Or, rather than using the SeqRecord approach and Bio.SeqIO, you could use the simpler GenBank specific code in Bio.GenBank which you may find easier?


Login before adding your answer.

Traffic: 3129 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6