Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
titleRetrieve Genbank Record By GI
from Bio import Entrez, SeqIO
 
handle = Entrez.efetch(db='protein', id='187932364', rettype='gb')
record = SeqIO.read(handle, 'genbank')
handle.close()
 

...

Parsing Genbank Files

The record that was parsed using SeqIO above is a Python object. Its features attribute is a list of BioPython SeqFeature objects. Each feature contains a list of "qualifiers", which contain information such as the locus tag, gene (if available), db_xrefs, etc. To see the qualifiers for a CDS feature in the Genbank record, we can run this code:

...

Dealing with GenBank files in Biopython by Peter Cock 

An Example Of Finding RefSeq Gene By Locus Tag

...