This is a test version of Biostars. For the public version, visit https://www.biostars.org.
genebank biopython get /chromosome="22" or /map="22q13.33"

Hey i can't get withbiopython SeqIO from genpept lines of source section /chromosome= and /map=

for example: https://www.ncbi.nlm.nih.gov/protein/NP_113642.1

I've been sitting on this problem for two days, please help!

ncbi protein genebank python genpept

1 answer

it is located in the qualifiers field of the feature

from Bio import SeqIO

recs = SeqIO.parse("input.gb", format="genbank")

# Go over each record
for rec in recs:

    # Go over each feature
    for feat in rec.features:
        chr = feat.qualifiers.get("chromosome")
        if chr:
            print (chr)

prints:

 ['22']

Log in to answer this question.