[Biopython] GenomeDiagram: scale down the the track

Asma Riyaz asmariyaz23 at gmail.com
Wed Mar 26 17:39:17 UTC 2014


Hi,

I am using GenomeDiagram to show some gene Id I was interested in. However
the length of the sequences I am using are huge and hence when I add a
feature, and in my case the feature may run only a couple of thousand base
pairs due to which the sigil is smaller.
Here is a snippet of my code:


*        gd_track_for_features= gd_diagram.new_track(1,name=seq_record.name
<http://seq_record.name>,greytrack=True,start=0,end=len(seq_record))*
*        gd_feature_set=gd_track_for_features.new_set()        *
*        if rec in oo_list:*
*           max_len=max(max_len,len(seq_record))*

*           for feature in seq_record.features:*
*               if feature.type == "gene":*
*                  try: *
*                     name=feature.qualifiers['gene']*
*                     if name[0] in ids:*

*
gd_feature_set.add_feature(feature,sigil="ARROW",arrowshaft_height=1.0,arrowhead_length=1.0,color=idToColorDict[name[0]],*
*
 label=True,name=name[0],label_position="start",*
*
 label_color=idToColorDict[name[0]],label_size=10,label_angle=0)*

*                  except KeyError:*
*                     pass  *




*
gd_diagram.draw(format="linear",pagesize='A4',fragments=1,start=0,end=7000000)*

Here is one thing I tried to do:

 when adding a new track, i specified start=0 and end=100 or 1000 or
10,0000-----> however this doesn't seem to scale down the track in anyway,
instead what I see are empty tracks as the feature I am looking at do not
exist in 1 to 1000 or 1 to 10,000.
I attempted the same with "draw" and specified a different end BUT neither
of it worked.

How could I display all the features that I need to ?

Thanks,
 Asma



More information about the Biopython mailing list