Bio::DOOP::Graphics::Feature - graphical representation of the features.
Version 0.13
This object represents a picture that contains all the sequence features of a subset. The module is quick enough to use it in your CGI scripts. You can also use it to visualize the subset.
Tibor Nagy, Godollo, Hungary
$pic = Bio::DOOP::Graphics::Feature->create($db,"1234"); Create new picture. Later you can add your own graphics elements to it. Arguments: 1. Bio::DOOP::DBSQL object 2. Subset primary id. Return type: Bio::DOOP::Graphics::Feature object
Add an RGB color to the specified drawing element. $image->add_color("background",200,200,200); $image->set_colors; The available drawing elements are the following : background, label, strip, utr, motif, tss.
Set all the colors. Allocate colors previously with add_color. Use this method only ONCE after you set all the colors. If you use it more than once, results will be strange.
Draws scale on the picture.
Draws scale lines through the whole image background.
Draws a specified sequence on the picture. This is internal code, so do not use it directly.
Draws all sequences from the subset. The first one is the reference species.
open IMAGE,">picture.png"; binmode IMAGE; print IMAGE $image->get_png; close IMAGE; Returns the png image. Use this when you finish the work and would like to see the result.
Returns the drawn image pointer. Useful for adding your own GD methods for uniq picture manipulation.
Returns a hash of arrays of hash of arrays reference that contains the map information. Here is a real world example of how to handle this method : use Bio::DOOP::DOOP; $db = Bio::DOOP::DBSQL->connect($user,$passwd,"doop-plant-1_5","localhost"); $cluster = Bio::DOOP::Cluster->new($db,'81001110','500'); $image = Bio::DOOP::Graphics::Feature->create($db,$cluster); for $motif (@{$image->get_map->{motif}}){ for $motif_id (keys %{$motif}){ @coords = @{$$motif{$motif_id}}; # Print out the motif primary id and the four coordinates in the picture # id x1 y1 x2 y2 print "$motif_id $coords[0] $coords[1] $coords[2] $coords[3]\n"; } } It is a somewhat difficult, but if you are familiar with references and nested data structures, you will understand it.
Returns only the arrayref of motif hashes.
$motifi = $image->get_motif_id_by_coord(100,200); Maybe this is the most useful method. You can get a motif id, if you specify a coordinate of a point. Return type: string
To install Bio::DOOP::DOOP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::DOOP::DOOP
CPAN shell
perl -MCPAN -e shell install Bio::DOOP::DOOP
For more information on module installation, please visit the detailed CPAN module installation guide.