1BP_FEATURE_DRAW(1) User Contributed Perl Documentation BP_FEATURE_DRAW(1)
2
3
4
6 feature_draw.pl -- Render a Bio::Graphics Feature File
7
9 feature_draw.pl [options] file.txt [file2.txt...] > rendering.png
10 feature_draw.pl [options] file.txt [file2.txt...] ⎪ display -
11
13 The feature_draw.pl script is a thin front end around the Bio::Graphics
14 module. It accepts a list of files containing sequence (protein, nu‐
15 cleotide) feature coordinates from the file(s) listed on the command
16 line or on standard input, renders them, and produces a PNG file on
17 standard output.
18
19 Options
20
21 This script uses GNU-style long options. This allows you to specify
22 the image width option, for example, with any of the following alterna‐
23 tive forms:
24
25 --width=800
26 --width 800
27 -width 800
28 -w 800
29
30 --width
31 This sets the width of the image, in pixels. The default is 800
32 pixels.
33
34 --range
35 This sets the range of the region displayed, in base pairs from
36 start to stop. Any of the following formats are accepted:
37
38 --range 1..1000
39 --range 1,1000
40 --range 1-1000
41
42 Negative ranges are allowed.
43
45 This script accepts and processes sequence annotations in a simple tab-
46 delimited format or in GFF format.
47
48 The feature file format has a configuration section and a data section.
49 The configuration section sets up the size and overall properties of
50 the image, and the data section gives the feature data itself.
51
52 Configuration Section
53
54 If not provided, this scripts generates a reasonable default configura‐
55 tion section for you, so you do not need to provide a configuration
56 section to get a reasonable image. However, to tune the appearance of
57 the image, you will probably want to tweak the configuration. Here is
58 an excerpt from the configuration section:
59
60 # example file
61 [general]
62 bases = -1000..21000
63 height = 12
64
65 [EST]
66 glyph = segments
67 bgcolor= yellow
68 connector = dashed
69 height = 5
70
71 [FGENES]
72 glyph = transcript2
73 bgcolor = green
74 description = 1
75
76 The configuration section is divided into a set of sections, each one
77 labeled with a [section title]. The [general] section specifies global
78 options for the entire image. Other sections apply to particular fea‐
79 ture types. In the example above, the configuration in the [EST] sec‐
80 tion applies to features labeled as ESTs, while the configuration in
81 the [FGENES] section applies to features labeled as predictions from
82 the FGENES gene prediction program.
83
84 Inside each section is a series of name=value pairs, where the name is
85 the name of an option to set. You can put whitespace around the = sign
86 to make it more readable, or even use a colon (:) if you prefer. The
87 following option names are recognized:
88
89 Option Value Example
90 ------ ----- -------
91
92 bases Min & max of the sequence range (bp) 1200..60000
93 width width of the image (pixels) 600
94 height Height of each graphical element (pixels) 10
95 glyph Style of each graphical element (see below) transcript
96 fgcolor Foreground color of each element yellow
97 bgcolor Background color of each element blue
98 linewidth Width of lines 3
99 label Print the feature's name 1
100 description Whether to print the feature's description 0
101 bump Elements are not allowed to collide 1
102 ticks Print tick marks on arrows 1
103 connector Type of group connector (dashed, hat or solid) dashed
104
105 The "bases" and "width" options are only relevant in the [general] sec‐
106 tion. They are overridden by the like-named command-line options.
107
108 The remainder of the options can be located in any section, but if
109 present in the [general] section will set defaults for the others.
110
111 Colors are English-language color names or Web-style #RRGGBB colors
112 (see a book on HTML for an explanation). True/false values are 1 for
113 true, and 0 for false. Numeric ranges can be expressed in start..end
114 fashion with two dots, or as start-end with a hyphen.
115
116 The "glyph" option controls how the features are rendered. The follow‐
117 ing glyphs are implemented:
118
119 Name Description
120 ---- -----------
121
122 box A filled rectangle, nondirectional.
123 ellipse An oval.
124 arrow An arrow; can be unidirectional or
125 bidirectional. It is also capable of displaying
126 a scale with major and minor tickmarks, and can
127 be oriented horizontally or vertically.
128 segments A set of filled rectangles connected by solid
129 lines. Used for interrupted features, such as
130 gapped alignments and exon groups.
131 transcript Similar to segments, but the connecting line is
132 a "hat" shape, and the direction of
133 transcription is indicated by a small arrow.
134 transcript2 Similar to transcript, but the direction of
135 transcription is indicated by a terminal segment
136 in the shape of an arrow.
137 primers Two inward pointing arrows connected by a line. Used for STSs.
138
139 The bump option is the most important option for controlling the look
140 of the image. If set to false (the number 0), then the features are
141 allowed to overlap. If set to true (the number 1), then the features
142 will move vertically to avoid colliding. If not specified, bump is
143 turned on if the number of any given type of sequence feature is
144 greater than 50.
145
146 Data Section
147
148 The data section can follow or proceed the configuration section. The
149 two sections can also be intermixed. The data section is a tab or
150 whitespace-delimited file which you can export from a spreadsheet
151 application or word processor file (be sure to save as text only!)
152
153 Here is an example data section:
154
155 Cosmid B0511 . 516-619 Cosmid B0511 .
156 3185-3294 Cosmid B0511 . 10946-11208 Cosmid B0511
157 . 13126-13511 Cosmid B0511 . 66-208 Cosmid
158 B0511 . 6354-6499 Cosmid B0511 .
159 13955-14115 EST yk595e6.5 + 3187-3294 EST
160 yk846e07.3 - 11015-11208 EST yk53c10
161 yk53c10.5 + 18892-19154
162 yk53c10.3 - 15000-15500,15700-15800 EST
163 yk53c10.5 + 16032-16105 SwissProt PECANEX +
164 13153-13656 Swedish fish FGENESH "Gene 1" -
165 1-205,518-616,661-735,3187-3365,3436-3846 Transmembrane domain
166 FGENESH "Gene 2" - 16626-17396,17451-17597 Kinase and
167 sushi domains
168
169 Each line of the file contains five columns. The columns are:
170
171 Column # Description
172 -------- -----------
173
174 1 feature type
175 2 feature name
176 3 strand
177 4 coordinates
178 5 description
179
180 Feature type
181 The feature type should correspond to one of the [feature type]
182 headings in the configuration section. If it doesn't, the [general]
183 options will be applied to the feature when rendering it. The fea‐
184 ture name is a name for the feature. Use a "." or "-" if this is
185 not relevant. If the name contains whitespace, put single or double
186 quotes ("") around the name.
187
188 Strand
189 The strand indicates which strand the feature is on. It is one of
190 "+" for the forward strand, "-" for the reverse strand, or "." for
191 features that are not stranded.
192
193 Coordinates
194 The coordinates column is a set of one or more ranges that the fea‐
195 ture occupies. Ranges are written using ".." as in start..stop, or
196 with hyphens, as in start-stop. For features that are composed of
197 multiple ranges &em; for example transcripts that have multiple
198 exons &em; you can either put the ranges on the same line separated
199 by commas or spaces, or put the ranges on individual lines and just
200 use the same feature name and type to group them. In the example
201 above, the Cosmid B0511 features use the individual line style,
202 while the FGENESH features use the all-ranges-on-one-line style.
203
204 Description
205 The last column contains some descriptive text. If the description
206 option is set to true, this text will be printed underneath the
207 feature in the rendering.
208
209 Finally, it is possible to group related features together. An example
210 is the ESTs yk53c10.5 and yk53c10.3, which are related by being reads
211 from the two ends of the clone yk53c10. To indicate this relationship,
212 generate a section that looks like this:
213
214 EST yk53c10
215 yk53c10.5 + 18892-19154
216 yk53c10.3 - 15000-15500,15700-15800
217
218 The group is indicated by a line that contains just two columns con‐
219 taining the feature type and a unique name for the group. Follow this
220 line with all the features that form the group, but leave the first
221 column (the feature type) blank. The group will be rendered by drawing
222 a dashed line between all the members of the group. You can change this
223 by specifying a different connector option in the configuration section
224 for this feature type.
225
227 Please report them to the author.
228
230 Bio::Graphics
231
233 Lincoln Stein, lstein@cshl.org
234
235
236
237perl v5.8.8 2007-05-07 BP_FEATURE_DRAW(1)