[gt-users] Creating my own images

Sascha Steinbiss steinbiss at zbh.uni-hamburg.de
Mon Feb 23 10:40:42 CET 2009


shafeeq rim wrote:
> Hi All,

Hello Shafeeq,

> 1) How can I can create my own symbols separately for each feature 
> like:- separate symbols for exon and different symbol for intron ... etc 
> etc...

At the moment, there are only a few 'primitive' symbol types:

*  "box", which draws the elements as an box with arrowheads depending 
on their strand property.
* "line", which draws the elements as straight lines with arrowheads 
depending on their strand property.
* "rectangle", which draws the elements as a box without arrowheads.
* "dashes", which draws the elements as straight lines with arrowheads 
depending on their strand property.
* "caret", which draws the elements as a '^'-like glyph (often used for 
introns). Arrowheads are drawn depending on the strand property.

These can be selected in a style file using the "style" property of the 
feature type in question (see http://genometools.org/style_options.html).

If you want to create your own glyph, you need to extend the GtGraphics 
and GtCanvas implementations containing the code to draw these primitives.

> 2) When I am plotting the annotation files of like full chromosome 21 I 
> am getting blank picture.

Which style file and which parameters did you use? Can you provide an 
example annotation file for testing?

> 3) Even for a bit larger files I am getting a message in PNG file 
> (Blocks not shown . Exceeded limit)

This is because of the default line limit which prevents images from 
being excessively large in the vertical dimension when lots of blocks 
overlap (e.g. when many features are packed tightly in a horizontally 
narrow image). This behaviour can be changed by adjusting the 
"max_num_lines" property in the style file (see 
http://genometools.org/style_options.html) or by increasing the image 
width so there is more space for the blocks to fit in.

> 4) If I want to use a Mysql database instead of the parser how can I do 
> that ?

As AnnotationSketch is primarily a programmer's library, it can be 
extended. There are several options:

* Use the Ruby/Python/Lua scripting bindings to access the database and 
manually create GenomeTools FeatureNodes from the selected annotation 
data (see "Using AnnotationSketch to draw user-generated annotations" in 
http://genometools.org/examples.html).

* Write a MySQLInStream class in C implementing the GtNodeStream 
interface and creating GtFeatureNodes from selected data returned by the 
MySQL C interface (for an example, see the BedInStream class). This 
stream can then be combined with the GtFeatureStream to fill a 
GtFeatureIndex which can then be passed to the layout engine as usual.

> I may require a whole picture  in some case.

This should be possible, but keep in mind that AnnotationSketch tries to 
keep drawn features (and their caption texts) non-overlapping in the 
output, so unless the captions are turned off (using the 
"max_capt_show_width" option), it may be that such pictures will be very 
large in terms of height.

> Thanks in advance
> Shafeeq

You're welcome,
Sascha

-- 
Sascha Steinbiss
Center for Bioinformatics
University of Hamburg
Bundesstr. 43
20146 Hamburg
Germany

Email:  steinbiss at zbh.uni-hamburg.de
URL:    http://www.zbh.uni-hamburg.de/steinbiss
Phone:  +49 (40) 42838 7322
FAX:    +49 (40) 42838 7312



More information about the gt-users mailing list