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