This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Label Names By Genomediagram, Biopython

I am using GenomeDiagram to draw linear genome fragments (using genbank SeqRecords). I found that, by default, the name of the labels correspond to 'locus_tag' (when I select to show the labels for 'CDS' features), and I would like to get the 'product' instead. Is there a way to select 'product' for the label names?

genome visualization biopython python

1 answer

This is controlled by the name_qualifiers attribute of the GenomeDiagram Feature object. By default it looks at these tags:

name_qualifiers = ['gene', 'label', 'name', 'locus_tag', 'product']

So one answer would be to override that setting (on every Feature object). Alternatively, you could edit the qualifiers of the SeqFeature before calling GenomeDiagram to copy the desired annotation into a new label or name qualifier which would then take precedence over the locus_tag.

Log in to answer this question.