bio-svgenes 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/README.md +88 -0
  2. data/VERSION +1 -1
  3. data/bio-svgenes.gemspec +131 -8
  4. data/doc/classes/Bio.html +131 -0
  5. data/doc/classes/Bio/Graphics.html +142 -0
  6. data/doc/classes/Bio/Graphics/Glyph.html +987 -0
  7. data/doc/classes/Bio/Graphics/Glyph.src/M000001.html +26 -0
  8. data/doc/classes/Bio/Graphics/Glyph.src/M000002.html +27 -0
  9. data/doc/classes/Bio/Graphics/Glyph.src/M000003.html +32 -0
  10. data/doc/classes/Bio/Graphics/Glyph.src/M000004.html +27 -0
  11. data/doc/classes/Bio/Graphics/Glyph.src/M000005.html +25 -0
  12. data/doc/classes/Bio/Graphics/Glyph.src/M000006.html +29 -0
  13. data/doc/classes/Bio/Graphics/Glyph.src/M000007.html +107 -0
  14. data/doc/classes/Bio/Graphics/Glyph.src/M000008.html +51 -0
  15. data/doc/classes/Bio/Graphics/Glyph.src/M000009.html +23 -0
  16. data/doc/classes/Bio/Graphics/Glyph.src/M000010.html +18 -0
  17. data/doc/classes/Bio/Graphics/Glyph.src/M000011.html +75 -0
  18. data/doc/classes/Bio/Graphics/Glyph.src/M000012.html +51 -0
  19. data/doc/classes/Bio/Graphics/Glyph.src/M000013.html +23 -0
  20. data/doc/classes/Bio/Graphics/Glyph.src/M000014.html +26 -0
  21. data/doc/classes/Bio/Graphics/Glyph.src/M000015.html +27 -0
  22. data/doc/classes/Bio/Graphics/Glyph.src/M000016.html +32 -0
  23. data/doc/classes/Bio/Graphics/Glyph.src/M000017.html +27 -0
  24. data/doc/classes/Bio/Graphics/Glyph.src/M000018.html +25 -0
  25. data/doc/classes/Bio/Graphics/Glyph.src/M000019.html +29 -0
  26. data/doc/classes/Bio/Graphics/Glyph.src/M000020.html +107 -0
  27. data/doc/classes/Bio/Graphics/Glyph.src/M000021.html +51 -0
  28. data/doc/classes/Bio/Graphics/Glyph.src/M000022.html +23 -0
  29. data/doc/classes/Bio/Graphics/Glyph.src/M000023.html +18 -0
  30. data/doc/classes/Bio/Graphics/Glyph.src/M000024.html +75 -0
  31. data/doc/classes/Bio/Graphics/MiniFeature.html +243 -0
  32. data/doc/classes/Bio/Graphics/MiniFeature.src/M000001.html +25 -0
  33. data/doc/classes/Bio/Graphics/MiniFeature.src/M000003.html +25 -0
  34. data/doc/classes/Bio/Graphics/MiniFeature.src/M000024.html +25 -0
  35. data/doc/classes/Bio/Graphics/Page.html +705 -0
  36. data/doc/classes/Bio/Graphics/Page.src/M000010.html +35 -0
  37. data/doc/classes/Bio/Graphics/Page.src/M000011.html +83 -0
  38. data/doc/classes/Bio/Graphics/Page.src/M000012.html +24 -0
  39. data/doc/classes/Bio/Graphics/Page.src/M000013.html +29 -0
  40. data/doc/classes/Bio/Graphics/Page.src/M000014.html +24 -0
  41. data/doc/classes/Bio/Graphics/Page.src/M000015.html +20 -0
  42. data/doc/classes/Bio/Graphics/Page.src/M000016.html +20 -0
  43. data/doc/classes/Bio/Graphics/Page.src/M000017.html +18 -0
  44. data/doc/classes/Bio/Graphics/Page.src/M000018.html +18 -0
  45. data/doc/classes/Bio/Graphics/Page.src/M000019.html +18 -0
  46. data/doc/classes/Bio/Graphics/Page.src/M000020.html +18 -0
  47. data/doc/classes/Bio/Graphics/Page.src/M000021.html +18 -0
  48. data/doc/classes/Bio/Graphics/Page.src/M000022.html +18 -0
  49. data/doc/classes/Bio/Graphics/Page.src/M000023.html +18 -0
  50. data/doc/classes/Bio/Graphics/Page.src/M000024.html +18 -0
  51. data/doc/classes/Bio/Graphics/Page.src/M000025.html +35 -0
  52. data/doc/classes/Bio/Graphics/Page.src/M000026.html +83 -0
  53. data/doc/classes/Bio/Graphics/Page.src/M000027.html +24 -0
  54. data/doc/classes/Bio/Graphics/Page.src/M000028.html +29 -0
  55. data/doc/classes/Bio/Graphics/Page.src/M000029.html +24 -0
  56. data/doc/classes/Bio/Graphics/Page.src/M000030.html +20 -0
  57. data/doc/classes/Bio/Graphics/Page.src/M000031.html +20 -0
  58. data/doc/classes/Bio/Graphics/Page.src/M000032.html +18 -0
  59. data/doc/classes/Bio/Graphics/Page.src/M000033.html +18 -0
  60. data/doc/classes/Bio/Graphics/Page.src/M000034.html +18 -0
  61. data/doc/classes/Bio/Graphics/Page.src/M000035.html +18 -0
  62. data/doc/classes/Bio/Graphics/Page.src/M000036.html +18 -0
  63. data/doc/classes/Bio/Graphics/Page.src/M000037.html +18 -0
  64. data/doc/classes/Bio/Graphics/Page.src/M000038.html +18 -0
  65. data/doc/classes/Bio/Graphics/Page.src/M000039.html +18 -0
  66. data/doc/classes/Bio/Graphics/Page.src/M000040.html +107 -0
  67. data/doc/classes/Bio/Graphics/Page.src/M000041.html +18 -0
  68. data/doc/classes/Bio/Graphics/Page.src/M000042.html +23 -0
  69. data/doc/classes/Bio/Graphics/Page.src/M000043.html +18 -0
  70. data/doc/classes/Bio/Graphics/Page.src/M000044.html +18 -0
  71. data/doc/classes/Bio/Graphics/Primitive.html +204 -0
  72. data/doc/classes/Bio/Graphics/Primitive.src/M000001.html +21 -0
  73. data/doc/classes/Bio/Graphics/Primitive.src/M000002.html +20 -0
  74. data/doc/classes/Bio/Graphics/Primitive.src/M000008.html +21 -0
  75. data/doc/classes/Bio/Graphics/Primitive.src/M000009.html +20 -0
  76. data/doc/classes/Bio/Graphics/Primitive.src/M000022.html +21 -0
  77. data/doc/classes/Bio/Graphics/Primitive.src/M000023.html +20 -0
  78. data/doc/classes/Bio/Graphics/SVGEE.html +290 -0
  79. data/doc/classes/Bio/Graphics/SVGEE.src/M000002.html +24 -0
  80. data/doc/classes/Bio/Graphics/SVGEE.src/M000003.html +18 -0
  81. data/doc/classes/Bio/Graphics/SVGEE.src/M000004.html +24 -0
  82. data/doc/classes/Bio/Graphics/SVGEE.src/M000005.html +18 -0
  83. data/doc/classes/Bio/Graphics/SVGEE.src/M000006.html +18 -0
  84. data/doc/classes/Bio/Graphics/SVGEE.src/M000007.html +21 -0
  85. data/doc/classes/Bio/Graphics/SVGEE.src/M000008.html +27 -0
  86. data/doc/classes/Bio/Graphics/SVGEE.src/M000009.html +23 -0
  87. data/doc/classes/Bio/Graphics/SVGEE.src/M000016.html +24 -0
  88. data/doc/classes/Bio/Graphics/SVGEE.src/M000017.html +18 -0
  89. data/doc/classes/Bio/Graphics/SVGEE.src/M000018.html +18 -0
  90. data/doc/classes/Bio/Graphics/SVGEE.src/M000019.html +21 -0
  91. data/doc/classes/Bio/Graphics/SVGEE.src/M000020.html +27 -0
  92. data/doc/classes/Bio/Graphics/SVGEE.src/M000021.html +23 -0
  93. data/doc/classes/Bio/Graphics/Track.html +473 -0
  94. data/doc/classes/Bio/Graphics/Track.src/M000001.html +35 -0
  95. data/doc/classes/Bio/Graphics/Track.src/M000002.html +18 -0
  96. data/doc/classes/Bio/Graphics/Track.src/M000003.html +28 -0
  97. data/doc/classes/Bio/Graphics/Track.src/M000004.html +18 -0
  98. data/doc/classes/Bio/Graphics/Track.src/M000010.html +35 -0
  99. data/doc/classes/Bio/Graphics/Track.src/M000011.html +18 -0
  100. data/doc/classes/Bio/Graphics/Track.src/M000012.html +28 -0
  101. data/doc/classes/Bio/Graphics/Track.src/M000013.html +18 -0
  102. data/doc/created.rid +1 -9
  103. data/doc/files/lib/bio-svgenes_rb.html +131 -0
  104. data/doc/files/lib/bio/graphics/glyph_rb.html +101 -0
  105. data/doc/files/lib/bio/graphics/mini_feature_rb.html +101 -0
  106. data/doc/files/lib/bio/graphics/page_rb.html +111 -0
  107. data/doc/files/lib/bio/graphics/primitive_rb.html +101 -0
  108. data/doc/files/lib/bio/graphics/svgee_rb.html +101 -0
  109. data/doc/files/lib/bio/graphics/track_rb.html +101 -0
  110. data/doc/fr_class_index.html +34 -0
  111. data/doc/fr_file_index.html +33 -0
  112. data/doc/fr_method_index.html +70 -0
  113. data/doc/index.html +21 -91
  114. data/doc/manual/bootstrap/css/bootstrap-responsive.css +1109 -0
  115. data/doc/manual/bootstrap/css/bootstrap-responsive.min.css +9 -0
  116. data/doc/manual/bootstrap/css/bootstrap.css +6158 -0
  117. data/doc/manual/bootstrap/css/bootstrap.min.css +9 -0
  118. data/doc/manual/bootstrap/img/glyphicons-halflings-white.png +0 -0
  119. data/doc/manual/bootstrap/img/glyphicons-halflings.png +0 -0
  120. data/doc/manual/bootstrap/js/bootstrap.js +2276 -0
  121. data/doc/manual/bootstrap/js/bootstrap.min.js +6 -0
  122. data/doc/manual/img/circle.png +0 -0
  123. data/doc/manual/img/directed.png +0 -0
  124. data/doc/manual/img/down_triangle.png +0 -0
  125. data/doc/manual/img/histogram.png +0 -0
  126. data/doc/manual/img/span.png +0 -0
  127. data/doc/manual/img/transcript.png +0 -0
  128. data/doc/manual/img/up_triangle.png +0 -0
  129. data/doc/manual/manual.html +360 -0
  130. data/doc/manual/manual.md +307 -0
  131. data/doc/rdoc-style.css +208 -0
  132. data/examples/example.rb +12 -8
  133. data/examples/{make_example.rb → example2.rb} +5 -16
  134. data/lib/bio/graphics/glyph.rb +293 -126
  135. data/lib/bio/graphics/mini_feature.rb +24 -17
  136. data/lib/bio/graphics/page.rb +112 -54
  137. data/lib/bio/graphics/primitive.rb +12 -9
  138. data/lib/bio/graphics/svgee.rb +9 -11
  139. data/lib/bio/graphics/track.rb +92 -10
  140. metadata +132 -9
  141. data/README.rdoc +0 -19
  142. data/examples/annotate_snps.rb +0 -86
  143. data/examples/eg2.rb +0 -40
  144. data/examples/get_coverage_in_windows.rb +0 -176
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-svgenes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-05 00:00:00.000000000 Z
12
+ date: 2013-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
@@ -114,13 +114,13 @@ executables: []
114
114
  extensions: []
115
115
  extra_rdoc_files:
116
116
  - LICENSE.txt
117
- - README.rdoc
117
+ - README.md
118
118
  files:
119
119
  - .document
120
120
  - Gemfile
121
121
  - Gemfile.lock
122
122
  - LICENSE.txt
123
- - README.rdoc
123
+ - README.md
124
124
  - Rakefile
125
125
  - VERSION
126
126
  - bio-svgenes.gemspec
@@ -133,7 +133,115 @@ files:
133
133
  - doc/Bio/Graphics/SVGEE.html
134
134
  - doc/Bio/Graphics/Track.html
135
135
  - doc/LICENSE_txt.html
136
+ - doc/classes/Bio.html
137
+ - doc/classes/Bio/Graphics.html
138
+ - doc/classes/Bio/Graphics/Glyph.html
139
+ - doc/classes/Bio/Graphics/Glyph.src/M000001.html
140
+ - doc/classes/Bio/Graphics/Glyph.src/M000002.html
141
+ - doc/classes/Bio/Graphics/Glyph.src/M000003.html
142
+ - doc/classes/Bio/Graphics/Glyph.src/M000004.html
143
+ - doc/classes/Bio/Graphics/Glyph.src/M000005.html
144
+ - doc/classes/Bio/Graphics/Glyph.src/M000006.html
145
+ - doc/classes/Bio/Graphics/Glyph.src/M000007.html
146
+ - doc/classes/Bio/Graphics/Glyph.src/M000008.html
147
+ - doc/classes/Bio/Graphics/Glyph.src/M000009.html
148
+ - doc/classes/Bio/Graphics/Glyph.src/M000010.html
149
+ - doc/classes/Bio/Graphics/Glyph.src/M000011.html
150
+ - doc/classes/Bio/Graphics/Glyph.src/M000012.html
151
+ - doc/classes/Bio/Graphics/Glyph.src/M000013.html
152
+ - doc/classes/Bio/Graphics/Glyph.src/M000014.html
153
+ - doc/classes/Bio/Graphics/Glyph.src/M000015.html
154
+ - doc/classes/Bio/Graphics/Glyph.src/M000016.html
155
+ - doc/classes/Bio/Graphics/Glyph.src/M000017.html
156
+ - doc/classes/Bio/Graphics/Glyph.src/M000018.html
157
+ - doc/classes/Bio/Graphics/Glyph.src/M000019.html
158
+ - doc/classes/Bio/Graphics/Glyph.src/M000020.html
159
+ - doc/classes/Bio/Graphics/Glyph.src/M000021.html
160
+ - doc/classes/Bio/Graphics/Glyph.src/M000022.html
161
+ - doc/classes/Bio/Graphics/Glyph.src/M000023.html
162
+ - doc/classes/Bio/Graphics/Glyph.src/M000024.html
163
+ - doc/classes/Bio/Graphics/MiniFeature.html
164
+ - doc/classes/Bio/Graphics/MiniFeature.src/M000001.html
165
+ - doc/classes/Bio/Graphics/MiniFeature.src/M000003.html
166
+ - doc/classes/Bio/Graphics/MiniFeature.src/M000024.html
167
+ - doc/classes/Bio/Graphics/Page.html
168
+ - doc/classes/Bio/Graphics/Page.src/M000010.html
169
+ - doc/classes/Bio/Graphics/Page.src/M000011.html
170
+ - doc/classes/Bio/Graphics/Page.src/M000012.html
171
+ - doc/classes/Bio/Graphics/Page.src/M000013.html
172
+ - doc/classes/Bio/Graphics/Page.src/M000014.html
173
+ - doc/classes/Bio/Graphics/Page.src/M000015.html
174
+ - doc/classes/Bio/Graphics/Page.src/M000016.html
175
+ - doc/classes/Bio/Graphics/Page.src/M000017.html
176
+ - doc/classes/Bio/Graphics/Page.src/M000018.html
177
+ - doc/classes/Bio/Graphics/Page.src/M000019.html
178
+ - doc/classes/Bio/Graphics/Page.src/M000020.html
179
+ - doc/classes/Bio/Graphics/Page.src/M000021.html
180
+ - doc/classes/Bio/Graphics/Page.src/M000022.html
181
+ - doc/classes/Bio/Graphics/Page.src/M000023.html
182
+ - doc/classes/Bio/Graphics/Page.src/M000024.html
183
+ - doc/classes/Bio/Graphics/Page.src/M000025.html
184
+ - doc/classes/Bio/Graphics/Page.src/M000026.html
185
+ - doc/classes/Bio/Graphics/Page.src/M000027.html
186
+ - doc/classes/Bio/Graphics/Page.src/M000028.html
187
+ - doc/classes/Bio/Graphics/Page.src/M000029.html
188
+ - doc/classes/Bio/Graphics/Page.src/M000030.html
189
+ - doc/classes/Bio/Graphics/Page.src/M000031.html
190
+ - doc/classes/Bio/Graphics/Page.src/M000032.html
191
+ - doc/classes/Bio/Graphics/Page.src/M000033.html
192
+ - doc/classes/Bio/Graphics/Page.src/M000034.html
193
+ - doc/classes/Bio/Graphics/Page.src/M000035.html
194
+ - doc/classes/Bio/Graphics/Page.src/M000036.html
195
+ - doc/classes/Bio/Graphics/Page.src/M000037.html
196
+ - doc/classes/Bio/Graphics/Page.src/M000038.html
197
+ - doc/classes/Bio/Graphics/Page.src/M000039.html
198
+ - doc/classes/Bio/Graphics/Page.src/M000040.html
199
+ - doc/classes/Bio/Graphics/Page.src/M000041.html
200
+ - doc/classes/Bio/Graphics/Page.src/M000042.html
201
+ - doc/classes/Bio/Graphics/Page.src/M000043.html
202
+ - doc/classes/Bio/Graphics/Page.src/M000044.html
203
+ - doc/classes/Bio/Graphics/Primitive.html
204
+ - doc/classes/Bio/Graphics/Primitive.src/M000001.html
205
+ - doc/classes/Bio/Graphics/Primitive.src/M000002.html
206
+ - doc/classes/Bio/Graphics/Primitive.src/M000008.html
207
+ - doc/classes/Bio/Graphics/Primitive.src/M000009.html
208
+ - doc/classes/Bio/Graphics/Primitive.src/M000022.html
209
+ - doc/classes/Bio/Graphics/Primitive.src/M000023.html
210
+ - doc/classes/Bio/Graphics/SVGEE.html
211
+ - doc/classes/Bio/Graphics/SVGEE.src/M000002.html
212
+ - doc/classes/Bio/Graphics/SVGEE.src/M000003.html
213
+ - doc/classes/Bio/Graphics/SVGEE.src/M000004.html
214
+ - doc/classes/Bio/Graphics/SVGEE.src/M000005.html
215
+ - doc/classes/Bio/Graphics/SVGEE.src/M000006.html
216
+ - doc/classes/Bio/Graphics/SVGEE.src/M000007.html
217
+ - doc/classes/Bio/Graphics/SVGEE.src/M000008.html
218
+ - doc/classes/Bio/Graphics/SVGEE.src/M000009.html
219
+ - doc/classes/Bio/Graphics/SVGEE.src/M000016.html
220
+ - doc/classes/Bio/Graphics/SVGEE.src/M000017.html
221
+ - doc/classes/Bio/Graphics/SVGEE.src/M000018.html
222
+ - doc/classes/Bio/Graphics/SVGEE.src/M000019.html
223
+ - doc/classes/Bio/Graphics/SVGEE.src/M000020.html
224
+ - doc/classes/Bio/Graphics/SVGEE.src/M000021.html
225
+ - doc/classes/Bio/Graphics/Track.html
226
+ - doc/classes/Bio/Graphics/Track.src/M000001.html
227
+ - doc/classes/Bio/Graphics/Track.src/M000002.html
228
+ - doc/classes/Bio/Graphics/Track.src/M000003.html
229
+ - doc/classes/Bio/Graphics/Track.src/M000004.html
230
+ - doc/classes/Bio/Graphics/Track.src/M000010.html
231
+ - doc/classes/Bio/Graphics/Track.src/M000011.html
232
+ - doc/classes/Bio/Graphics/Track.src/M000012.html
233
+ - doc/classes/Bio/Graphics/Track.src/M000013.html
136
234
  - doc/created.rid
235
+ - doc/files/lib/bio-svgenes_rb.html
236
+ - doc/files/lib/bio/graphics/glyph_rb.html
237
+ - doc/files/lib/bio/graphics/mini_feature_rb.html
238
+ - doc/files/lib/bio/graphics/page_rb.html
239
+ - doc/files/lib/bio/graphics/primitive_rb.html
240
+ - doc/files/lib/bio/graphics/svgee_rb.html
241
+ - doc/files/lib/bio/graphics/track_rb.html
242
+ - doc/fr_class_index.html
243
+ - doc/fr_file_index.html
244
+ - doc/fr_method_index.html
137
245
  - doc/images/add.png
138
246
  - doc/images/arrow_up.png
139
247
  - doc/images/brick.png
@@ -166,18 +274,33 @@ files:
166
274
  - doc/js/search.js
167
275
  - doc/js/search_index.js
168
276
  - doc/js/searcher.js
277
+ - doc/manual/bootstrap/css/bootstrap-responsive.css
278
+ - doc/manual/bootstrap/css/bootstrap-responsive.min.css
279
+ - doc/manual/bootstrap/css/bootstrap.css
280
+ - doc/manual/bootstrap/css/bootstrap.min.css
281
+ - doc/manual/bootstrap/img/glyphicons-halflings-white.png
282
+ - doc/manual/bootstrap/img/glyphicons-halflings.png
283
+ - doc/manual/bootstrap/js/bootstrap.js
284
+ - doc/manual/bootstrap/js/bootstrap.min.js
285
+ - doc/manual/img/circle.png
286
+ - doc/manual/img/directed.png
287
+ - doc/manual/img/down_triangle.png
288
+ - doc/manual/img/histogram.png
289
+ - doc/manual/img/span.png
290
+ - doc/manual/img/transcript.png
291
+ - doc/manual/img/up_triangle.png
292
+ - doc/manual/manual.html
293
+ - doc/manual/manual.md
294
+ - doc/rdoc-style.css
169
295
  - doc/rdoc.css
170
296
  - doc/table_of_contents.html
171
- - examples/annotate_snps.rb
172
297
  - examples/data.txt
173
298
  - examples/draw_from_json.rb
174
- - examples/eg2.rb
175
299
  - examples/example.rb
176
300
  - examples/example.svg
301
+ - examples/example2.rb
177
302
  - examples/example_config.json
178
303
  - examples/gene.gff
179
- - examples/get_coverage_in_windows.rb
180
- - examples/make_example.rb
181
304
  - examples/transcripts.gff
182
305
  - lib/bio-svgenes.rb
183
306
  - lib/bio/graphics/glyph.rb
@@ -210,7 +333,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
333
  version: '0'
211
334
  segments:
212
335
  - 0
213
- hash: 1136117613783362089
336
+ hash: 2365228172068893639
214
337
  required_rubygems_version: !ruby/object:Gem::Requirement
215
338
  none: false
216
339
  requirements:
@@ -1,19 +0,0 @@
1
- = bio-svgenes
2
-
3
- Description goes here.
4
-
5
- == Contributing to bio-svgenes
6
-
7
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
- * Fork the project
10
- * Start a feature/bugfix branch
11
- * Commit and push until you are happy with your contribution
12
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
-
15
- == Copyright
16
-
17
- Copyright (c) 2012 Dan MacLean. See LICENSE.txt for
18
- further details.
19
-
@@ -1,86 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # untitled
4
- #
5
- # Created by Dan MacLean (TSL) on 2012-10-30.
6
- # Copyright (c) . All rights reserved.
7
- ###################################################
8
-
9
- require 'ostruct'
10
-
11
- class DanGFF
12
- attr_accessor :seqname, :source, :attributes, :start, :end, :strand, :feature, :phase, :score
13
-
14
- def initialize(line)
15
- @seqname, @source, @feature, @start, @end, @score, @strand, @phase, @attributes = line.split(/\t/)
16
- @start = @start.to_i
17
- @end = @end.to_i
18
- end
19
-
20
- def parent
21
- self.attributes =~ /Parent=(.*?);/
22
- $1
23
- end
24
-
25
- def overlaps?(other)
26
- if (self.seqname == other.seqname and self.start >= other.start and self.start <= other.end)
27
- return true
28
- elsif (self.seqname == other.seqname and self.end >= other.start and self.end <= other.end)
29
- return true
30
- end
31
- end
32
-
33
- def contains?(other)
34
- if self.seqname == other.seqname and self.start <= other.start and self.end >= other.end
35
- return true
36
- else
37
- return false
38
- end
39
- end
40
-
41
- end
42
- features_file = ARGV.shift
43
- bam_file = ARGV.shift
44
- bgi_snp_file = ARGV.shift
45
- #rest = data dump files from R
46
-
47
- #get SNP list (position, methodd)
48
- ARGV.each do |file|
49
- snps = []
50
- file =~ /(.*)_r_dump.csv/
51
- id = $1
52
- File.open(file,"r").each do |line|
53
- next if line=~ /Method/
54
- snp = OpenStruct.new
55
- snp.index, snp.pos, snp.method =line.chomp.split(/,/)
56
- snp.index = snp.index.to_i
57
- snp.pos = snp.pos.to_i
58
- snp.seqname = id
59
- snp.start = snp.pos
60
- snp.end = snp.pos
61
- snps << snp
62
- end
63
- features = []
64
- File.open(features_file, "r").each do |line|
65
- feature = DanGFF.new(line)
66
- features << feature if feature.seqname == id and feature.feature == "mRNA"
67
- end
68
-
69
- features.each do |f|
70
- snps.each do |snp|
71
- if feature.contains(snp)
72
- snp_info = case snp.method
73
- when "BGI"
74
- get_snp_from_bgi(snp)
75
- when "PileUp"
76
- get_snp_from_pileup(snp)
77
- when "VCF"
78
- get_snp_from_vcf(snp)
79
- end
80
- print snp_out(snp,snp_info)
81
- end
82
- end
83
- end
84
-
85
- end
86
-
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # untitled
4
- #
5
- # Created by Dan MacLean (TSL) on 2012-09-28.
6
- # Copyright (c) . All rights reserved.
7
- ###################################################
8
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
9
- $LOAD_PATH.unshift(File.dirname(__FILE__))
10
-
11
- require 'bio-svgenes'
12
- require 'pp'
13
- p = Bio::Graphics::Page.new(:width => 800,
14
- :height => 200,
15
- :number_of_intervals => 10)
16
-
17
-
18
-
19
-
20
- transcript_track_last = p.add_track(:glyph => :transcript,
21
- :name => 'transcripts (grouped models)',
22
- :label => true,
23
- :exon_fill_color => 'green',
24
- :utr_fill_color => {:type => :radial, :id => :custom, :cx => 5, :cy => 5, :r => 50, :fx => 50, :fy => 50, :stops => [ {:offset => 0, :color => 'rgb(255,255,255)', :opacity => 0}, {:offset => 100, :color => 'rgb(0,127,200)', :opacity => 1},]},
25
- :line_color => 'black',
26
- :feature_height => 20 )
27
-
28
-
29
- feature3 = Bio::Graphics::MiniFeature.new(:start => 3631,
30
- :end => 5899,
31
- :strand => '+',
32
- :exons => [4486,4605,4706,5095,5174,5326],
33
- :utrs => [3631,4485,5631,5899])
34
- #:utrs => [3631,4276,5439,5899])
35
- transcript_track_last.add(feature3)
36
-
37
-
38
- p.draw
39
-
40
- #pp p
@@ -1,176 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # get_coverage_in_windows.rb
4
- #
5
- # Created by Dan MacLean (TSL) on 2012-10-05.
6
- # Copyright (c) . All rights reserved.
7
- ###################################################
8
- require 'optparse'
9
- require 'pp'
10
- options = {}
11
- optparse = OptionParser.new do|opts|
12
-
13
- opts.on( '-b', '--bam FILE', ' name of sorrted BAM file' ) do |b|
14
- options[:bam] = b
15
-
16
- end
17
- opts.on( '-f', '--reference_file STRING', 'name of the reference sequence fasta file' ) do |f|
18
- options[:fasta] = f
19
-
20
- end
21
- opts.on( '-c', '--chromosome STRING', 'name of the chromosome / contig in the fasta file' ) do |c|
22
- options[:chrom] = c
23
-
24
- end
25
- opts.on( '-s', '--start INT', 'start position)' ) do |s|
26
- options[:start] = s.to_i
27
-
28
- end
29
- opts.on( '-e', '--stop INT', 'stop position' ) do |e|
30
- options[:stop] = e.to_i
31
-
32
- end
33
- opts.on( '-w', '--step INT', 'window size to use' ) do |w|
34
- options[:step] = w.to_i
35
-
36
- end
37
- opts.on( '-o', '--bam_opts INT', 'bio-samtools BAM opts' ) do |o|
38
- options[:bam_opts] = o ||= {:min_mapping_quality => 20, :min_base_quality => 30}
39
-
40
- end
41
- # This displays the help screen, all programs are
42
- # assumed to have this option.
43
- opts.on( '-h', '--help', 'Display this screen' ) do
44
- puts opts
45
- puts %{Example: ruby get_coverage_in_windows.rb --bam my_bam.bam --reference_file ref.fasta --chromosome contig1 --start 2000 --stop 3000 --step 100 --bam_opts {:min_mapping_quality => 20, :min_base_quality => 20}}
46
- exit
47
- end
48
- end
49
- optparse.parse!
50
-
51
- options[:bam_opts] = {:min_mapping_quality => 20}
52
-
53
-
54
- ###Actual script ---
55
- require 'rubygems'
56
- require 'bio-samtools'
57
- require 'enumerator'
58
- bam = Bio::DB::Sam.new({:bam=>options[:bam], :fasta=>options[:fasta]} )
59
- bam.open
60
-
61
- def passes_quality(aln, options)
62
- if aln.mapq > options[:bam_opts][:min_mapping_quality] && aln.is_mapped
63
- true
64
- else
65
- false
66
- end
67
- end
68
-
69
- def actually_modify(cigar_arr, bases_to_ignore_at_start)
70
- result = []
71
- bases_ditched = 0
72
- cigar_arr.each do |arr|
73
- if arr[0] < bases_to_ignore_at_start - bases_ditched
74
- bases_ditched += arr[0]
75
- elsif arr[0] + bases_ditched >= bases_to_ignore_at_start && bases_ditched < bases_to_ignore_at_start
76
- remainder = arr[0] - (bases_to_ignore_at_start - bases_ditched)
77
- bases_ditched += (bases_to_ignore_at_start - bases_ditched)
78
- result << [remainder, arr[1]] unless remainder == 0
79
- elsif bases_ditched >= bases_to_ignore_at_start
80
- result << [arr[0],arr[1]]
81
- else
82
- raise "Shouldn't ever happen. Did though... Panic. Alarums. Etc."
83
- exit
84
- end
85
- end
86
- result
87
- end
88
-
89
- def correct_cigar_for_overlaps(cigar_arr, bases_to_ignore_at_start, bases_to_ignore_at_end)
90
- #takes the end off the cigar arr if the bases it describes are outside the window
91
- return cigar_arr if bases_to_ignore_at_start == 0 && bases_to_ignore_at_end == 0
92
- result = actually_modify(cigar_arr,bases_to_ignore_at_start)
93
- actually_modify(result.reverse, bases_to_ignore_at_end).reverse
94
- end
95
-
96
- (options[:start]..options[:stop]).step(options[:step]) do |start|
97
- positions = Array.new(options[:step], 0.0)
98
-
99
- bam.fetch(options[:chrom], start, start + options[:step]).each do |aln|
100
- next unless passes_quality(aln, options)
101
-
102
- #update start and end for overhanging clipped bases
103
- a = aln.cigar.split(/([A-Z])/)
104
- cigar_arr = a.enum_for(:each_slice, 2).to_a #convert to array of arrays
105
- cigar_arr.collect!{|a| [a.first.to_i, a.last] } #convert numbers to ints
106
- if cigar_arr.first.last == "S" or cigar_arr.first.last == "H"
107
- aln.pos = aln.pos - cigar_arr.first.first
108
- aln.pos = 1 if aln.pos < 1 #ignore negative overhangs...
109
- end
110
-
111
- if cigar_arr.last.last == "S" or cigar_arr.last.last == "H"
112
- aln.calend = aln.calend - cigar_arr.last.first
113
- aln.calend = 1 if aln.calend < 1
114
- end
115
-
116
- ##remove any padding operations, we're only concerned with alignments relative to the reference, not other reads..
117
- cigar_arr.delete_if {|b| b.last == "P"}
118
- #need to know whether start outside window ...
119
- bases_to_ignore_at_start = 0
120
- bases_to_ignore_at_end = 0
121
-
122
- if aln.pos < start
123
- bases_to_ignore_at_start = start - aln.pos
124
- end
125
-
126
- if aln.calend >= start + options[:step] ## left hand border is included in window, right hand border excluded
127
- bases_to_ignore_at_end = aln.calend - (start + options[:step]) + 1
128
- end
129
-
130
- cigar_arr = correct_cigar_for_overlaps(cigar_arr.dup, bases_to_ignore_at_start, bases_to_ignore_at_end)
131
- #puts "start ignore = #{bases_to_ignore_at_start}"
132
- #puts "end ignore = #{bases_to_ignore_at_end}"
133
- #modify the read objects start and stop positions to keep only the bit in the window
134
- #ignore soft clipping at the start and end
135
- if bases_to_ignore_at_start >0
136
- aln.pos = aln.pos + bases_to_ignore_at_start
137
- end
138
- if bases_to_ignore_at_end > 0
139
- aln.calend = aln.calend - bases_to_ignore_at_end
140
- end
141
-
142
- begin
143
- raise "aln start >= aln end" if aln.pos > aln.calend
144
- rescue
145
- next
146
- else
147
- read_start_corrected = aln.pos - start
148
- read_end_corrected = aln.calend - start
149
- range_start = read_start_corrected
150
- range_stop = read_end_corrected
151
- positions[range_start..range_stop] = positions.slice(range_start..range_stop).collect! {|a| a += 1}
152
- ranges_to_decrement = []
153
- dist_through_read = 0
154
- cigar_arr.each_with_index do |cigar,i|
155
- #use the corrected cigar array to correct the coverage post-hoc
156
- if cigar.last == "D" or cigar.last == "N"
157
- ranges_to_decrement << Range.new(read_start_corrected + dist_through_read, read_start_corrected + dist_through_read + cigar.first - 1)
158
- end
159
- dist_through_read += cigar.first
160
- end #end cigar_arr each
161
- #pp ranges_to_decrement unless ranges_to_decrement.empty?
162
- ranges_to_decrement.each do |range|
163
- begin
164
- positions[range] = positions.slice(range).collect! {|b| b -= 1}
165
- rescue
166
- puts "Error: positions array likely out of range ... this error affects one read only ... so we'll skip it. Panic if you get lots of this"
167
- end
168
- end
169
- end
170
- end #end fetch
171
- average = positions.inject(0) {|r,e| r + e} / positions.length.to_f
172
- puts [start, start + options[:step], average].join("\t")
173
-
174
- end
175
-
176
- bam.close