-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathREADME
executable file
·146 lines (112 loc) · 4.79 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Bio::Graphics - Generate GD images of Bio::Seq objects
SYNOPSIS
This is a simple GD-based renderer (diagram drawer) for DNA and
protein sequences. It is used from Perl like this:
use Bio::Graphics;
use Bio::DB::BioFetch; # or some other Bio::SeqI generator
# get a Bio::SeqI object somehow
my $bf = Bio::DB::BioFetch->new;
my $cosmid = $bf->get_Seq_by_id('CEF58D5');
my @features = $cosmid->all_SeqFeatures;
my @CDS = grep {$_->primary_tag eq 'CDS'} @features;
my @gene = grep {$_->primary_tag eq 'gene'} @features;
my @tRNAs = grep {$_->primary_tag eq 'tRNA'} @features;
# let the drawing begin...
my $panel = Bio::Graphics::Panel->new(
-segment => $cosmid,
-width => 800
);
$panel->add_track(arrow => $cosmid,
-bump => 0,
-double=>1,
-tick => 2);
$panel->add_track(transcript => \@gene,
-bgcolor => 'blue',
-fgcolor => 'black',
-key => 'Genes',
-bump => +1,
-height => 10,
-label => 1,
-description=> 1
) ;
$panel->add_track(transcript2 => \@CDS,
-bgcolor => 'cyan',
-fgcolor => 'black',
-key => 'CDS',
-bump => +1,
-height => 10,
-label => 1,
-description=> 1,
);
$panel->add_track(generic => \@tRNAs,
-bgcolor => 'red',
-fgcolor => 'black',
-key => 'tRNAs',
-bump => +1,
-height => 8,
-label => 1,
);
my $gd = $panel->gd;
print $gd->can('png') ? $gd->png : $gd->gif;
DESCRIPTION
The Bio::Graphics::Panel class provides drawing and formatting
services for any object that implements the Bio::SeqFeatureI
interface, including Ace::Sequence::Feature, Das::Segment::Feature and
Bio::DB::Graphics objects. It can be used to draw sequence
annotations, physical (contig) maps, protein domains, or any other
type of map in which a set of discrete ranges need to be laid out on
the number line.
The module supports a drawing style in which each type of feature
occupies a discrete "track" that spans the width of the display. Each
track will have its own distinctive "glyph", a configurable graphical
representation of the feature.
The module also supports a more flexible style in which several
different feature types and their associated glyphs can occupy the
same track. The choice of glyph is under run-time control.
Semantic zooming (for instance, changing the type of glyph depending
on the density of features) is supported by a callback system for
configuration variables. The module has built-in support for Bio::Das
stylesheets, and stylesheet-driven configuration can be intermixed
with semantic zooming, if desired.
You can add a key to the generated image using either of two key
styles. One style places the key captions at the top of each track.
The other style generates a graphical key at the bottom of the image.
Note that this modules depends on Bio::Perl, GD and the
Text::Parsewords module.
A good tutorial on this module can be found at
http://www.bioperl.org/wiki/HOWTO:Graphics.
BUILDING AND INSTALLING
From the directory in which this README file is located:
% perl ./Build.PL
% ./Build test
% ./Build install
The last step may need to be run as root.
You can test whether the module is working by running the testit.pl
script located in the eg subdirectory. It produces a PNG file, so you
should pipe the output to an image displayer, such as xv:
eg/testit.pl | xv -
THE FEATURE_DRAW.PL SCRIPT
This module contains a simple script named "feature_draw.pl" that
takes a file of annotations and generates an image. When first built,
the script lives in the "scripts" subdirectory. After installation,
the script will be moved into your system-wide scripts directory
(usually /usr/bin or something similar).
There is a sample features file in the "eg" subdirectory. After
building, but before installation, you can run the following command
from the directory in which this README file is located:
% scripts/feature_draw.pl eg/feature_data.txt | display -
This is piping the output directly to the "display" program, part of
the ImageMagick package. Replace with your favorite PNG-capable
display program.
After installation, feature_draw.pl will be available on your command
path. Run "man feature_draw.pl" to see the manual page, or use the -h
option to get a quick summary of usage.
THE GENERIC GENOME BROWSER
The gbrowse script, part of the Generic Genome Browser package, has
been moved into its own package. It creates a high-performance
web-based genome browser based on the Bio::Graphics package. You can
get it by anonymous CVS to SourceForge:
cvs -d:pserver:[email protected]:/cvsroot/gmod \
co Generic-Genome-Browser
Lincoln Stein <[email protected]>
12 December 2008