[Biopython] meddling with GeneDiagram
Peter Cock
p.j.a.cock at googlemail.com
Wed Mar 7 16:39:19 UTC 2012
On Wed, Mar 7, 2012 at 4:18 PM, A M Torres, Hugo
<mnemonico at posthocergopropterhoc.net> wrote:
> Fellow biopythoneers,
>
> I've been playing around with GenomeDiagram trying to draw a gene's
> features. My impressions are this is a very nifty tool indeed.
Complex though ;)
> However I see a problem in the way I would can draw a gene though it might
> be just my inexperience with as a user: The sigil don't
> automatically distinguish between a FeatureLocation with fuzzy
> position(i.e. BeforePosition(0)) and a feature with an exact position (i.e.
> ExactPosition(6475)).
No, it doesn't.
> As example suppose I would like to draw the genes from a SeqRecord object
> built from the TP53 genbank file:
> ...
>
> The resulting image looks like gene_diagram.svg. There seems to be a WRAP53
> gene on the minus strand and the sigil represents it as awhole gene. but
> its only a portion of it. Maybe we could represent its just a piece by
> drawing the arrowhead pointing inwards instead of outwards as in
> gene_arrow.png.
>
> Is that possible to implement?
Somewhat related is cropping of features only partly in view, and a
general 'jaggy' feature for showing truncation in some why. Leighton
and I did discuss the later and there is an implementation on a branch
which didn't make it into Biopython 1.59 but could be in the next release.
At its simplest this is a sigil with a jagged edge at both ends, useful
for marking things like NNNNN regions in scaffolds/supercontigs, or
even perhaps repeat regions. Dealing with the left and right ends of
sigils generically would be more powerful though, and more complex.
That would be required for your example - arrow head at one end, so
kind of truncation marker at the other.
We've also talked about other wish list ideas like exons and links,
frame aware placement, frame less placement, etc. All these kinds
of things only make sense a "high zoom" or if drawing small genomes
like viruses - while original GenomeDiagram targeted entire bacteria
("low zoom", or "zoomed out") where you only needed and wanted
a simple box for each gene.
Peter
More information about the Biopython
mailing list