bio-graphics 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/doc/classes/Bio.html +135 -0
  2. data/doc/classes/Bio/Graphics.html +247 -0
  3. data/doc/classes/Bio/Graphics/Panel.html +344 -0
  4. data/doc/classes/Bio/Graphics/Panel.src/M000005.html +29 -0
  5. data/doc/classes/Bio/Graphics/Panel.src/M000006.html +19 -0
  6. data/doc/classes/Bio/Graphics/Panel.src/M000007.html +67 -0
  7. data/doc/classes/Bio/Graphics/Panel/Ruler.html +238 -0
  8. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000008.html +20 -0
  9. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000009.html +28 -0
  10. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000010.html +54 -0
  11. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000013.html +20 -0
  12. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000014.html +28 -0
  13. data/doc/classes/Bio/Graphics/Panel/Ruler.src/M000015.html +59 -0
  14. data/doc/classes/Bio/Graphics/Panel/Track.html +342 -0
  15. data/doc/classes/Bio/Graphics/Panel/Track.src/M000008.html +23 -0
  16. data/doc/classes/Bio/Graphics/Panel/Track.src/M000009.html +42 -0
  17. data/doc/classes/Bio/Graphics/Panel/Track.src/M000010.html +285 -0
  18. data/doc/classes/Bio/Graphics/Panel/Track.src/M000011.html +23 -0
  19. data/doc/classes/Bio/Graphics/Panel/Track.src/M000012.html +43 -0
  20. data/doc/classes/Bio/Graphics/Panel/Track.src/M000013.html +259 -0
  21. data/doc/classes/Bio/Graphics/Panel/Track/Feature.html +292 -0
  22. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000011.html +65 -0
  23. data/doc/classes/Bio/Graphics/Panel/Track/Feature.src/M000014.html +65 -0
  24. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.html +155 -0
  25. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000012.html +18 -0
  26. data/doc/classes/Bio/Graphics/Panel/Track/Feature/PixelRange.src/M000015.html +18 -0
  27. data/doc/classes/ImageMap.html +185 -0
  28. data/doc/classes/ImageMap.src/M000001.html +18 -0
  29. data/doc/classes/ImageMap.src/M000002.html +24 -0
  30. data/doc/classes/ImageMap/ImageMapElement.html +187 -0
  31. data/doc/classes/ImageMap/ImageMapElement.src/M000003.html +19 -0
  32. data/doc/classes/ImageMap/ImageMapElement.src/M000004.html +20 -0
  33. data/doc/created.rid +1 -0
  34. data/doc/files/README_DEV.html +432 -0
  35. data/doc/files/TUTORIAL.html +358 -0
  36. data/doc/files/lib/bio-graphics_rb.html +121 -0
  37. data/doc/files/lib/bio/graphics/feature_rb.html +113 -0
  38. data/doc/files/lib/bio/graphics/image_map_rb.html +113 -0
  39. data/doc/files/lib/bio/graphics/panel_rb.html +113 -0
  40. data/doc/files/lib/bio/graphics/ruler_rb.html +113 -0
  41. data/doc/files/lib/bio/graphics/track_rb.html +113 -0
  42. data/doc/fr_class_index.html +35 -0
  43. data/doc/fr_file_index.html +34 -0
  44. data/doc/fr_method_index.html +41 -0
  45. data/doc/images/example.png +0 -0
  46. data/doc/images/glyph_showcase.png +0 -0
  47. data/doc/images/terms.png +0 -0
  48. data/doc/images/terms.svg +166 -0
  49. data/doc/index.html +24 -0
  50. data/images/example.png +0 -0
  51. data/images/glyph_showcase.png +0 -0
  52. data/images/terms.png +0 -0
  53. data/images/terms.svg +166 -0
  54. data/lib/bio-graphics.rb +18 -0
  55. data/lib/bio/graphics/feature.rb +136 -0
  56. data/lib/bio/graphics/image_map.rb +37 -0
  57. data/lib/bio/graphics/panel.rb +205 -0
  58. data/lib/bio/graphics/ruler.rb +96 -0
  59. data/lib/bio/graphics/track.rb +387 -0
  60. data/samples/arkdb_features.rb +37 -0
  61. data/samples/data.txt +32 -0
  62. data/samples/glyph_showcase.rb +29 -0
  63. metadata +137 -0
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (Bio::Graphics::Panel::Ruler)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 28</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">panel</span>, <span class="ruby-identifier">colour</span> = [<span class="ruby-value">0</span>,<span class="ruby-value">0</span>,<span class="ruby-value">0</span>])
15
+ <span class="ruby-ivar">@panel</span> = <span class="ruby-identifier">panel</span>
16
+ <span class="ruby-ivar">@name</span> = <span class="ruby-value str">'ruler'</span>
17
+ <span class="ruby-ivar">@colour</span> = <span class="ruby-identifier">colour</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>calculate_tick_distance (Bio::Graphics::Panel::Ruler)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 35</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calculate_tick_distance</span>
15
+ <span class="ruby-identifier">min_tick_distance_requirement_met</span> = <span class="ruby-keyword kw">false</span>
16
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> = <span class="ruby-value">1</span> <span class="ruby-comment cmt"># in basepairs.
17
+ <span class="ruby-keyword kw">while</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">min_tick_distance_requirement_met</span>
18
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span><span class="ruby-operator">/</span><span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-constant">RULER_MIN_DISTANCE_TICKS_PIXEL</span>
19
+ <span class="ruby-identifier">min_tick_distance_requirement_met</span> = <span class="ruby-keyword kw">true</span>
20
+ <span class="ruby-keyword kw">else</span>
21
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span><span class="ruby-operator">*</span><span class="ruby-value">5</span>
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+
25
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">major_tick_distance</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">minor_tick_distance</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>
26
+ <span class="ruby-keyword kw">end</span></pre>
27
+ </body>
28
+ </html>
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>draw (Bio::Graphics::Panel::Ruler)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/bio/graphics/ruler.rb, line 49</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draw</span>(<span class="ruby-identifier">panel_drawing</span>, <span class="ruby-identifier">vertical_offset</span>)
15
+ <span class="ruby-identifier">ruler_drawing</span> = <span class="ruby-constant">Cairo</span><span class="ruby-operator">::</span><span class="ruby-constant">Context</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">panel_drawing</span>)
16
+
17
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">calculate_tick_distance</span>
18
+
19
+ <span class="ruby-comment cmt"># Draw line
20
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-value">0</span>,<span class="ruby-value">10</span>)
21
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">line_to</span>(<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">width</span>, <span class="ruby-value">10</span>)
22
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">stroke</span>
23
+
24
+ <span class="ruby-comment cmt"># Draw ticks
25
+ <span class="ruby-comment cmt"># * Find position of first tick.
26
+ <span class="ruby-comment cmt"># Most of the time, we don't want the first tick on the very first
27
+ <span class="ruby-comment cmt"># basepair of the view. Suppose that would be position 333 in the
28
+ <span class="ruby-comment cmt"># sequence. Then the numbers under the major tickmarks would be:
29
+ <span class="ruby-comment cmt"># 343, 353, 363, 373 and so on. Instead, we want 350, 360, 370, 380.
30
+ <span class="ruby-comment cmt"># So we want to find the position of the first tick.
31
+ <span class="ruby-identifier">first_tick_position</span> = <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>
32
+ <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">first_tick_position</span>.<span class="ruby-identifier">modulo</span>(<span class="ruby-identifier">minor_tick_distance</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
33
+ <span class="ruby-identifier">first_tick_position</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
34
+ <span class="ruby-keyword kw">end</span>
35
+
36
+ <span class="ruby-comment cmt"># * And start drawing the rest.
37
+ <span class="ruby-identifier">first_tick_position</span>.<span class="ruby-identifier">step</span>(<span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_stop</span>, <span class="ruby-identifier">minor_tick_distance</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tick</span><span class="ruby-operator">|</span>
38
+ <span class="ruby-identifier">tick_pixel_position</span> = (<span class="ruby-identifier">tick</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">display_start</span>) <span class="ruby-operator">/</span> <span class="ruby-identifier">panel</span>.<span class="ruby-identifier">rescale_factor</span>
39
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">tick_pixel_position</span>.<span class="ruby-identifier">floor</span>, <span class="ruby-value">5</span>)
40
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tick</span>.<span class="ruby-identifier">modulo</span>(<span class="ruby-identifier">major_tick_distance</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
41
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-value">0</span>, <span class="ruby-value">15</span>)
42
+
43
+ <span class="ruby-comment cmt"># Draw tick number
44
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">select_font_face</span>(<span class="ruby-value str">'Georgia'</span>, <span class="ruby-value">1</span>, <span class="ruby-value">1</span>)
45
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">set_font_size</span>(<span class="ruby-constant">RULER_TEXT_HEIGHT</span>)
46
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">move_to</span>(<span class="ruby-identifier">tick_pixel_position</span>.<span class="ruby-identifier">floor</span>, <span class="ruby-value">20</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RULER_TEXT_HEIGHT</span>)
47
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">show_text</span>(<span class="ruby-identifier">tick</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>)
48
+ <span class="ruby-keyword kw">else</span>
49
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">rel_line_to</span>(<span class="ruby-value">0</span>, <span class="ruby-value">5</span>)
50
+
51
+ <span class="ruby-keyword kw">end</span>
52
+ <span class="ruby-identifier">ruler_drawing</span>.<span class="ruby-identifier">stroke</span>
53
+ <span class="ruby-keyword kw">end</span>
54
+
55
+
56
+ <span class="ruby-ivar">@height</span> = <span class="ruby-value">25</span> <span class="ruby-operator">+</span> <span class="ruby-constant">RULER_TEXT_HEIGHT</span>
57
+ <span class="ruby-keyword kw">end</span></pre>
58
+ </body>
59
+ </html>
@@ -0,0 +1,342 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: Bio::Graphics::Panel::Track</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">Bio::Graphics::Panel::Track</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../../../files/lib/bio/graphics/feature_rb.html">
59
+ lib/bio/graphics/feature.rb
60
+ </a>
61
+ <br />
62
+ <a href="../../../../files/lib/bio/graphics/track_rb.html">
63
+ lib/bio/graphics/track.rb
64
+ </a>
65
+ <br />
66
+ </td>
67
+ </tr>
68
+
69
+ <tr class="top-aligned-row">
70
+ <td><strong>Parent:</strong></td>
71
+ <td>
72
+ Object
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ </div>
77
+ <!-- banner header -->
78
+
79
+ <div id="bodyContent">
80
+
81
+
82
+
83
+ <div id="contextContent">
84
+
85
+ <div id="description">
86
+ <p>
87
+ The Bio::Graphics::Track class describes the container for features of the
88
+ same type. See <a href="../../Graphics.html">Bio::Graphics</a>
89
+ documentation for explanation of interplay between different classes.
90
+ </p>
91
+
92
+ </div>
93
+
94
+
95
+ </div>
96
+
97
+ <div id="method-list">
98
+ <h3 class="section-bar">Methods</h3>
99
+
100
+ <div class="name-list">
101
+ <a href="#M000009">add_feature</a>&nbsp;&nbsp;
102
+ <a href="#M000010">draw</a>&nbsp;&nbsp;
103
+ <a href="#M000008">new</a>&nbsp;&nbsp;
104
+ </div>
105
+ </div>
106
+
107
+ </div>
108
+
109
+
110
+ <!-- if includes -->
111
+
112
+ <div id="section">
113
+
114
+ <div id="class-list">
115
+ <h3 class="section-bar">Classes and Modules</h3>
116
+
117
+ Class <a href="Track/Feature.html" class="link">Bio::Graphics::Panel::Track::Feature</a><br />
118
+
119
+ </div>
120
+
121
+
122
+
123
+
124
+ <div id="attribute-list">
125
+ <h3 class="section-bar">Attributes</h3>
126
+
127
+ <div class="name-list">
128
+ <table>
129
+ <tr class="top-aligned-row context-row">
130
+ <td class="context-item-name">feature_colour</td>
131
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
132
+ <td class="context-item-desc"></td>
133
+ </tr>
134
+ <tr class="top-aligned-row context-row">
135
+ <td class="context-item-name">feature_glyph</td>
136
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
137
+ <td class="context-item-desc"></td>
138
+ </tr>
139
+ <tr class="top-aligned-row context-row">
140
+ <td class="context-item-name">features</td>
141
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
142
+ <td class="context-item-desc"></td>
143
+ </tr>
144
+ <tr class="top-aligned-row context-row">
145
+ <td class="context-item-name">height</td>
146
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
147
+ <td class="context-item-desc"></td>
148
+ </tr>
149
+ <tr class="top-aligned-row context-row">
150
+ <td class="context-item-name">name</td>
151
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
152
+ <td class="context-item-desc"></td>
153
+ </tr>
154
+ <tr class="top-aligned-row context-row">
155
+ <td class="context-item-name">number_of_times_bumped</td>
156
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
157
+ <td class="context-item-desc"></td>
158
+ </tr>
159
+ <tr class="top-aligned-row context-row">
160
+ <td class="context-item-name">panel</td>
161
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
162
+ <td class="context-item-desc"></td>
163
+ </tr>
164
+ </table>
165
+ </div>
166
+ </div>
167
+
168
+
169
+
170
+ <!-- if method_list -->
171
+ <div id="methods">
172
+ <h3 class="section-bar">Public Class methods</h3>
173
+
174
+ <div id="method-M000008" class="method-detail">
175
+ <a name="M000008"></a>
176
+
177
+ <div class="method-heading">
178
+ <a href="Track.src/M000008.html" target="Code" class="method-signature"
179
+ onclick="popupCode('Track.src/M000008.html');return false;">
180
+ <span class="method-name">new</span><span class="method-args">(panel, name, feature_colour = [0,0,1], feature_glyph = 'generic')</span>
181
+ </a>
182
+ </div>
183
+
184
+ <div class="method-description">
185
+ <p>
186
+ !!Not to be used directly. Use <a
187
+ href="../Panel.html#M000006">Bio::Graphics::Panel.add_track</a> instead!! A
188
+ track can not exist except within the confines of a <a
189
+ href="../Panel.html">Bio::Graphics::Panel</a> object.
190
+ </p>
191
+ <hr size="1"></hr><p>
192
+ <b>Arguments</b>:
193
+ </p>
194
+ <ul>
195
+ <li><em>panel</em> (required) :: <a
196
+ href="../Panel.html">Bio::Graphics::Panel</a> object that this track
197
+ belongs to
198
+
199
+ </li>
200
+ <li><em>name</em> (required) :: Name of the track to be displayed (e.g.
201
+ &#8216;genes&#8217;)
202
+
203
+ </li>
204
+ <li><em>colour</em> :: Colour to be used to <a
205
+ href="Track.html#M000010">draw</a> the features within the track. Default =
206
+ &#8216;blue&#8216;
207
+
208
+ </li>
209
+ <li><em>glyph</em> :: Glyph to use for drawing the features. Options are:
210
+ &#8216;generic&#8217;, &#8216;directed_generic&#8217;, &#8216;spliced,
211
+ &#8216;directed_spliced&#8217; and &#8216;triangle&#8217;. Triangles can be
212
+ used for features whose start and stop positions are the same (e.g. SNPs).
213
+ If you try to <a href="Track.html#M000010">draw</a> a feature that is
214
+ longer with triangles, an error will be shown.
215
+
216
+ </li>
217
+ </ul>
218
+ <table>
219
+ <tr><td valign="top"><b>Returns</b>:</td><td>Bio::Graphics::Track object
220
+
221
+ </td></tr>
222
+ </table>
223
+ </div>
224
+ </div>
225
+
226
+ <h3 class="section-bar">Public Instance methods</h3>
227
+
228
+ <div id="method-M000009" class="method-detail">
229
+ <a name="M000009"></a>
230
+
231
+ <div class="method-heading">
232
+ <a href="Track.src/M000009.html" target="Code" class="method-signature"
233
+ onclick="popupCode('Track.src/M000009.html');return false;">
234
+ <span class="method-name">add_feature</span><span class="method-args">(name, location_string = '1..' + @panel.length.to_s, link = nil)</span>
235
+ </a>
236
+ </div>
237
+
238
+ <div class="method-description">
239
+ <p>
240
+ Adds a <a
241
+ href="Track/Feature.html">Bio::Graphics::Panel::Track::Feature</a> to this
242
+ track. A track contains features of the same type, e.g. (for sequence
243
+ annotation:) genes, polymorphisms, ESTs, etc.
244
+ </p>
245
+ <pre>
246
+ est_track.add_feature('EST1','50..60')
247
+ est_track.add_feature('EST2','52..73')
248
+ est_track.add_feature('EST3','41..69')
249
+ gene_track.add_feature('gene2','39..73')
250
+ </pre>
251
+ <p>
252
+ For spliced features:
253
+ </p>
254
+ <pre>
255
+ est_track.add_feature('EST4','join(34..53,153..191)')
256
+ </pre>
257
+ <p>
258
+ Or on the complement strand:
259
+ </p>
260
+ <pre>
261
+ est_track.add_feature('EST5','complement(join(34..53,153..191))')
262
+ </pre>
263
+ <p>
264
+ See the documentation in Bio::Locations for a full description of how
265
+ locations can be defined.
266
+ </p>
267
+ <p>
268
+ Features are only added if they are at least partly in the displayed
269
+ region. If a feature is completely outside of the region, it&#8216;s not
270
+ added. If it should be only partly visible, it is added completely.
271
+ </p>
272
+ <hr size="1"></hr><p>
273
+ <b>Arguments</b>:
274
+ </p>
275
+ <ul>
276
+ <li><em>name</em> (required) :: Name of the feature
277
+
278
+ </li>
279
+ <li><em>location</em> :: String. Default: whole of panel, forward strand.
280
+
281
+ </li>
282
+ <li><em>link</em> :: URL to link to for this glyph
283
+
284
+ </li>
285
+ </ul>
286
+ <table>
287
+ <tr><td valign="top"><b>Returns</b>:</td><td>Bio::Graphics::Track::Feature object that was created or nil
288
+
289
+ </td></tr>
290
+ </table>
291
+ </div>
292
+ </div>
293
+
294
+ <div id="method-M000010" class="method-detail">
295
+ <a name="M000010"></a>
296
+
297
+ <div class="method-heading">
298
+ <a href="Track.src/M000010.html" target="Code" class="method-signature"
299
+ onclick="popupCode('Track.src/M000010.html');return false;">
300
+ <span class="method-name">draw</span><span class="method-args">(panel_drawing, vertical_offset)</span>
301
+ </a>
302
+ </div>
303
+
304
+ <div class="method-description">
305
+ <p>
306
+ Adds the track to a cairo drawing. This method should not be used directly
307
+ by the user, but is called by <a
308
+ href="../Panel.html#M000007">Bio::Graphics::Panel.draw</a>
309
+ </p>
310
+ <hr size="1"></hr><p>
311
+ <b>Arguments</b>:
312
+ </p>
313
+ <ul>
314
+ <li><em>paneldrawing</em> (required) :: the panel cairo object
315
+
316
+ </li>
317
+ <li><em>verticaloffset</em> (required) :: number of pixels to offset the track
318
+ downwards, based on the height of other tracks that were drawn above it
319
+
320
+ </li>
321
+ </ul>
322
+ <table>
323
+ <tr><td valign="top"><b>Returns</b>:</td><td>FIXME: I don&#8216;t know
324
+
325
+ </td></tr>
326
+ </table>
327
+ </div>
328
+ </div>
329
+
330
+
331
+ </div>
332
+
333
+
334
+ </div>
335
+
336
+
337
+ <div id="validator-badges">
338
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
339
+ </div>
340
+
341
+ </body>
342
+ </html>