bio-samtools-wrapper 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.travis.yml +27 -0
- data/Gemfile +20 -0
- data/LICENSE.txt +702 -0
- data/README.md +501 -0
- data/Rakefile +73 -0
- data/VERSION +1 -0
- data/bin/bam_consensus.rb +85 -0
- data/bio-samtools-wrapper.gemspec +181 -0
- data/doc/Bio/DB/Alignment.html +552 -0
- data/doc/Bio/DB/Pileup.html +711 -0
- data/doc/Bio/DB/SAM/Library.html +167 -0
- data/doc/Bio/DB/SAM/Tools.html +109 -0
- data/doc/Bio/DB/SAM.html +1853 -0
- data/doc/Bio/DB/Tag.html +208 -0
- data/doc/Bio/DB/Vcf.html +431 -0
- data/doc/Bio/DB.html +105 -0
- data/doc/Bio.html +175 -0
- data/doc/LICENSE_txt.html +846 -0
- data/doc/created.rid +9 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/fonts.css +167 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +106 -0
- data/doc/js/darkfish.js +140 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +109 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +580 -0
- data/doc/table_of_contents.html +305 -0
- data/ext/Makefile-bioruby.patch +12 -0
- data/ext/Makefile-suse.patch +11 -0
- data/ext/mkrf_conf.rb +118 -0
- data/lib/bio/BIOExtensions.rb +89 -0
- data/lib/bio/db/alignment.rb +64 -0
- data/lib/bio/db/fastadb.rb +320 -0
- data/lib/bio/db/pileup.rb +273 -0
- data/lib/bio/db/sam/external/COPYING +21 -0
- data/lib/bio/db/sam/external/VERSION +1 -0
- data/lib/bio/db/sam/library.rb +32 -0
- data/lib/bio/db/sam.rb +778 -0
- data/lib/bio/db/vcf.rb +105 -0
- data/lib/bio-samtools-wrapper.rb +9 -0
- data/test/.gitignore +1 -0
- data/test/helper.rb +18 -0
- data/test/sample.vcf +24 -0
- data/test/samples/.gitignore +1 -0
- data/test/samples/LCI/NC_001988.ffn +2 -0
- data/test/samples/LCI/test.bam +0 -0
- data/test/samples/LCI/test.bam.bai +0 -0
- data/test/samples/small/dupes.bam +0 -0
- data/test/samples/small/dupes.sam +274 -0
- data/test/samples/small/ids2.txt +1 -0
- data/test/samples/small/map_for_reheader.sam +8 -0
- data/test/samples/small/map_to_merge1.bam +0 -0
- data/test/samples/small/map_to_merge1.bam.bai +0 -0
- data/test/samples/small/map_to_merge1.sam +8 -0
- data/test/samples/small/map_to_merge2.bam +0 -0
- data/test/samples/small/map_to_merge2.bam.bai +0 -0
- data/test/samples/small/map_to_merge2.sam +8 -0
- data/test/samples/small/no_md.sam +8 -0
- data/test/samples/small/sorted.bam +0 -0
- data/test/samples/small/sorted.bam.bai +0 -0
- data/test/samples/small/test.sai +0 -0
- data/test/samples/small/test.tam +10 -0
- data/test/samples/small/test_chr.fasta +1000 -0
- data/test/samples/small/test_chr.fasta.1.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.2.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.3.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.4.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.amb +2 -0
- data/test/samples/small/test_chr.fasta.ann +3 -0
- data/test/samples/small/test_chr.fasta.bwt +0 -0
- data/test/samples/small/test_chr.fasta.pac +0 -0
- data/test/samples/small/test_chr.fasta.rbwt +0 -0
- data/test/samples/small/test_chr.fasta.rev.1.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.rev.2.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.rpac +0 -0
- data/test/samples/small/test_chr.fasta.rsa +0 -0
- data/test/samples/small/test_chr.fasta.sa +0 -0
- data/test/samples/small/test_cov.svg +273 -0
- data/test/samples/small/test_fastadb.fasta +34 -0
- data/test/samples/small/testu.bam +0 -0
- data/test/samples/small/testu.bed +2 -0
- data/test/test_bio-samtools-wrapper.rb +1 -0
- data/test/test_fastadb.rb +89 -0
- data/test/test_pileup.rb +90 -0
- data/test/test_sam.rb +421 -0
- data/test/test_vcf.rb +79 -0
- data/tutorial/tutorial.html +474 -0
- data/tutorial/tutorial.md +424 -0
- data/tutorial/tutorial.pdf +0 -0
- metadata +254 -0
@@ -0,0 +1,711 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Bio::DB::Pileup - Pileup</title>
|
8
|
+
|
9
|
+
<link href="../../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../../js/jquery.js"></script>
|
17
|
+
<script src="../../js/navigation.js"></script>
|
18
|
+
<script src="../../js/search_index.js"></script>
|
19
|
+
<script src="../../js/search.js"></script>
|
20
|
+
<script src="../../js/searcher.js"></script>
|
21
|
+
<script src="../../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
<div id="parent-class-section" class="nav-section">
|
61
|
+
<h3>Parent</h3>
|
62
|
+
|
63
|
+
|
64
|
+
<p class="link">Object
|
65
|
+
|
66
|
+
</div>
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
|
76
|
+
<li ><a href="#method-c-iupac_to_base">::iupac_to_base</a>
|
77
|
+
|
78
|
+
<li ><a href="#method-c-new">::new</a>
|
79
|
+
|
80
|
+
<li ><a href="#method-i-genotype_list">#genotype_list</a>
|
81
|
+
|
82
|
+
<li ><a href="#method-i-non_ref_count">#non_ref_count</a>
|
83
|
+
|
84
|
+
<li ><a href="#method-i-non_refs">#non_refs</a>
|
85
|
+
|
86
|
+
<li ><a href="#method-i-parse_indel">#parse_indel</a>
|
87
|
+
|
88
|
+
<li ><a href="#method-i-ref_count">#ref_count</a>
|
89
|
+
|
90
|
+
<li ><a href="#method-i-to_s">#to_s</a>
|
91
|
+
|
92
|
+
<li ><a href="#method-i-to_vcf">#to_vcf</a>
|
93
|
+
|
94
|
+
</ul>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
</nav>
|
99
|
+
|
100
|
+
<main role="main" aria-labelledby="class-Bio::DB::Pileup">
|
101
|
+
<h1 id="class-Bio::DB::Pileup" class="class">
|
102
|
+
class Bio::DB::Pileup
|
103
|
+
</h1>
|
104
|
+
|
105
|
+
<section class="description">
|
106
|
+
|
107
|
+
</section>
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<section class="attribute-method-details" class="method-section">
|
121
|
+
<header>
|
122
|
+
<h3>Attributes</h3>
|
123
|
+
</header>
|
124
|
+
|
125
|
+
|
126
|
+
<div id="attribute-i-ar1" class="method-detail">
|
127
|
+
<div class="method-heading attribute-method-heading">
|
128
|
+
<span class="method-name">ar1</span><span
|
129
|
+
class="attribute-access-type">[RW]</span>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
<div class="method-description">
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<div id="attribute-i-ar2" class="method-detail">
|
140
|
+
<div class="method-heading attribute-method-heading">
|
141
|
+
<span class="method-name">ar2</span><span
|
142
|
+
class="attribute-access-type">[RW]</span>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="method-description">
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div id="attribute-i-ar3" class="method-detail">
|
153
|
+
<div class="method-heading attribute-method-heading">
|
154
|
+
<span class="method-name">ar3</span><span
|
155
|
+
class="attribute-access-type">[RW]</span>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div class="method-description">
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div id="attribute-i-consensus" class="method-detail">
|
166
|
+
<div class="method-heading attribute-method-heading">
|
167
|
+
<span class="method-name">consensus</span><span
|
168
|
+
class="attribute-access-type">[RW]</span>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
<div class="method-description">
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div id="attribute-i-consensus_quality" class="method-detail">
|
179
|
+
<div class="method-heading attribute-method-heading">
|
180
|
+
<span class="method-name">consensus_quality</span><span
|
181
|
+
class="attribute-access-type">[RW]</span>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div class="method-description">
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
<div id="attribute-i-coverage" class="method-detail">
|
192
|
+
<div class="method-heading attribute-method-heading">
|
193
|
+
<span class="method-name">coverage</span><span
|
194
|
+
class="attribute-access-type">[RW]</span>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="method-description">
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
<div id="attribute-i-indel_1" class="method-detail">
|
205
|
+
<div class="method-heading attribute-method-heading">
|
206
|
+
<span class="method-name">indel_1</span><span
|
207
|
+
class="attribute-access-type">[RW]</span>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<div class="method-description">
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
</div>
|
215
|
+
</div>
|
216
|
+
|
217
|
+
<div id="attribute-i-indel_2" class="method-detail">
|
218
|
+
<div class="method-heading attribute-method-heading">
|
219
|
+
<span class="method-name">indel_2</span><span
|
220
|
+
class="attribute-access-type">[RW]</span>
|
221
|
+
</div>
|
222
|
+
|
223
|
+
<div class="method-description">
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
|
230
|
+
<div id="attribute-i-pos" class="method-detail">
|
231
|
+
<div class="method-heading attribute-method-heading">
|
232
|
+
<span class="method-name">pos</span><span
|
233
|
+
class="attribute-access-type">[RW]</span>
|
234
|
+
</div>
|
235
|
+
|
236
|
+
<div class="method-description">
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
</div>
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div id="attribute-i-read_bases" class="method-detail">
|
244
|
+
<div class="method-heading attribute-method-heading">
|
245
|
+
<span class="method-name">read_bases</span><span
|
246
|
+
class="attribute-access-type">[RW]</span>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="method-description">
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
|
256
|
+
<div id="attribute-i-read_quals" class="method-detail">
|
257
|
+
<div class="method-heading attribute-method-heading">
|
258
|
+
<span class="method-name">read_quals</span><span
|
259
|
+
class="attribute-access-type">[RW]</span>
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<div class="method-description">
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
</div>
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<div id="attribute-i-ref_base" class="method-detail">
|
270
|
+
<div class="method-heading attribute-method-heading">
|
271
|
+
<span class="method-name">ref_base</span><span
|
272
|
+
class="attribute-access-type">[RW]</span>
|
273
|
+
</div>
|
274
|
+
|
275
|
+
<div class="method-description">
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
|
282
|
+
<div id="attribute-i-ref_name" class="method-detail">
|
283
|
+
<div class="method-heading attribute-method-heading">
|
284
|
+
<span class="method-name">ref_name</span><span
|
285
|
+
class="attribute-access-type">[RW]</span>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<div class="method-description">
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
</div>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
<div id="attribute-i-rms_mapq" class="method-detail">
|
296
|
+
<div class="method-heading attribute-method-heading">
|
297
|
+
<span class="method-name">rms_mapq</span><span
|
298
|
+
class="attribute-access-type">[RW]</span>
|
299
|
+
</div>
|
300
|
+
|
301
|
+
<div class="method-description">
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
</div>
|
306
|
+
</div>
|
307
|
+
|
308
|
+
<div id="attribute-i-snp_quality" class="method-detail">
|
309
|
+
<div class="method-heading attribute-method-heading">
|
310
|
+
<span class="method-name">snp_quality</span><span
|
311
|
+
class="attribute-access-type">[RW]</span>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
<div class="method-description">
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
</div>
|
319
|
+
</div>
|
320
|
+
|
321
|
+
</section>
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
326
|
+
<header>
|
327
|
+
<h3>Public Class Methods</h3>
|
328
|
+
</header>
|
329
|
+
|
330
|
+
|
331
|
+
<div id="method-c-iupac_to_base" class="method-detail ">
|
332
|
+
|
333
|
+
<div class="method-heading">
|
334
|
+
<span class="method-name">iupac_to_base</span><span
|
335
|
+
class="method-args">(alt_base)</span>
|
336
|
+
|
337
|
+
<span class="method-click-advice">click to toggle source</span>
|
338
|
+
|
339
|
+
</div>
|
340
|
+
|
341
|
+
|
342
|
+
<div class="method-description">
|
343
|
+
|
344
|
+
<p>returns the two bases for the corresponding iupac code</p>
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
<div class="method-source-code" id="iupac_to_base-source">
|
350
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 177</span>
|
351
|
+
<span class="ruby-keyword">def</span> <span class="ruby-constant">Pileup</span>.<span class="ruby-identifier">iupac_to_base</span>(<span class="ruby-identifier">alt_base</span>)
|
352
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">alt_base</span>
|
353
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'K'</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">'G'</span>,<span class="ruby-string">'T'</span>]
|
354
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'M'</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">'A'</span>,<span class="ruby-string">'C'</span>]
|
355
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'S'</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">'C'</span>,<span class="ruby-string">'G'</span>]
|
356
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'R'</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">'A'</span>,<span class="ruby-string">'G'</span>]
|
357
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'W'</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">'A'</span>,<span class="ruby-string">'T'</span>]
|
358
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">'Y'</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">'C'</span>,<span class="ruby-string">'T'</span>]
|
359
|
+
<span class="ruby-keyword">else</span> <span class="ruby-identifier">alt_base</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">//</span>)
|
360
|
+
<span class="ruby-keyword">end</span>
|
361
|
+
<span class="ruby-keyword">end</span></pre>
|
362
|
+
</div>
|
363
|
+
|
364
|
+
</div>
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
</div>
|
370
|
+
|
371
|
+
|
372
|
+
<div id="method-c-new" class="method-detail ">
|
373
|
+
|
374
|
+
<div class="method-heading">
|
375
|
+
<span class="method-name">new</span><span
|
376
|
+
class="method-args">(pile_up_line)</span>
|
377
|
+
|
378
|
+
<span class="method-click-advice">click to toggle source</span>
|
379
|
+
|
380
|
+
</div>
|
381
|
+
|
382
|
+
|
383
|
+
<div class="method-description">
|
384
|
+
|
385
|
+
<p>creates the <a href="Pileup.html">Pileup</a> object</p>
|
386
|
+
|
387
|
+
<pre>pile_up_line = "seq2\t151\tG\tG\t36\t0\t99\t12\t...........A\t:9<;;7=<<<<<"
|
388
|
+
pile = Bio::DB::Pileup.new(pile_up_line)</pre>
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
<div class="method-source-code" id="new-source">
|
394
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 35</span>
|
395
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">pile_up_line</span>)
|
396
|
+
<span class="ruby-identifier">cols</span> = <span class="ruby-identifier">pile_up_line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\t/</span>)
|
397
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">cols</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">6</span> <span class="ruby-comment">##should only be able to get 6 lines from mpileup</span>
|
398
|
+
<span class="ruby-ivar">@ref_name</span>, <span class="ruby-ivar">@pos</span>, <span class="ruby-ivar">@ref_base</span>, <span class="ruby-ivar">@coverage</span>, <span class="ruby-ivar">@read_bases</span>, <span class="ruby-ivar">@read_quals</span> = <span class="ruby-identifier">cols</span>
|
399
|
+
<span class="ruby-keyword">elsif</span> (<span class="ruby-value">10</span><span class="ruby-operator">..</span><span class="ruby-value">13</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">cols</span>.<span class="ruby-identifier">length</span>) <span class="ruby-comment">##incase anyone tries to use deprecated pileup with -c flag we get upto 13 cols...</span>
|
400
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">cols</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">==</span> <span class="ruby-string">'*'</span> <span class="ruby-comment">#indel</span>
|
401
|
+
<span class="ruby-ivar">@ref_name</span>, <span class="ruby-ivar">@pos</span>, <span class="ruby-ivar">@ref_base</span>, <span class="ruby-ivar">@consensus</span>, <span class="ruby-ivar">@consensus_quality</span>, <span class="ruby-ivar">@snp_quality</span>, <span class="ruby-ivar">@rms_mapq</span>, <span class="ruby-ivar">@coverage</span>, <span class="ruby-ivar">@indel_1</span>, <span class="ruby-ivar">@indel_2</span>, <span class="ruby-ivar">@ar1</span>, <span class="ruby-ivar">@ar2</span>, <span class="ruby-ivar">@ar3</span> = <span class="ruby-identifier">cols</span>
|
402
|
+
<span class="ruby-keyword">else</span> <span class="ruby-comment">#snp / identity</span>
|
403
|
+
<span class="ruby-ivar">@ref_name</span>, <span class="ruby-ivar">@pos</span>, <span class="ruby-ivar">@ref_base</span>, <span class="ruby-ivar">@consensus</span>, <span class="ruby-ivar">@consensus_quality</span>, <span class="ruby-ivar">@snp_quality</span>, <span class="ruby-ivar">@rms_mapq</span>, <span class="ruby-ivar">@coverage</span>, <span class="ruby-ivar">@read_bases</span>, <span class="ruby-ivar">@read_quals</span> = <span class="ruby-identifier">cols</span>
|
404
|
+
<span class="ruby-keyword">end</span>
|
405
|
+
<span class="ruby-ivar">@consensus_quality</span> = <span class="ruby-ivar">@consensus_quality</span>.<span class="ruby-identifier">to_f</span>
|
406
|
+
<span class="ruby-ivar">@snp_quality</span> = <span class="ruby-ivar">@snp_quality</span>.<span class="ruby-identifier">to_f</span>
|
407
|
+
<span class="ruby-ivar">@rms_mapq</span> = <span class="ruby-ivar">@rms_mapq</span>.<span class="ruby-identifier">to_f</span>
|
408
|
+
<span class="ruby-keyword">else</span>
|
409
|
+
<span class="ruby-comment">#raise RuntimeError, "parsing line '#{pile_up_line.chomp}' failed"</span>
|
410
|
+
<span class="ruby-keyword">end</span>
|
411
|
+
|
412
|
+
<span class="ruby-ivar">@pos</span> = <span class="ruby-ivar">@pos</span>.<span class="ruby-identifier">to_i</span>
|
413
|
+
<span class="ruby-ivar">@coverage</span> = <span class="ruby-ivar">@coverage</span>.<span class="ruby-identifier">to_f</span>
|
414
|
+
<span class="ruby-ivar">@ref_count</span> = <span class="ruby-keyword">nil</span>
|
415
|
+
<span class="ruby-ivar">@non_ref_count_hash</span> = <span class="ruby-keyword">nil</span>
|
416
|
+
<span class="ruby-ivar">@non_ref_count</span> = <span class="ruby-keyword">nil</span>
|
417
|
+
<span class="ruby-keyword">end</span></pre>
|
418
|
+
</div>
|
419
|
+
|
420
|
+
</div>
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
</div>
|
426
|
+
|
427
|
+
|
428
|
+
</section>
|
429
|
+
|
430
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
431
|
+
<header>
|
432
|
+
<h3>Public Instance Methods</h3>
|
433
|
+
</header>
|
434
|
+
|
435
|
+
|
436
|
+
<div id="method-i-genotype_list" class="method-detail ">
|
437
|
+
|
438
|
+
<div class="method-heading">
|
439
|
+
<span class="method-name">genotype_list</span><span
|
440
|
+
class="method-args">()</span>
|
441
|
+
|
442
|
+
<span class="method-click-advice">click to toggle source</span>
|
443
|
+
|
444
|
+
</div>
|
445
|
+
|
446
|
+
|
447
|
+
<div class="method-description">
|
448
|
+
|
449
|
+
<p>identifies the reference base and returns the indel or snp genotype as
|
450
|
+
applicable</p>
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
<div class="method-source-code" id="genotype_list-source">
|
456
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 167</span>
|
457
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">genotype_list</span>
|
458
|
+
<span class="ruby-keyword">if</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref_base</span> <span class="ruby-operator">==</span> <span class="ruby-string">'*'</span>
|
459
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">indel_gt</span>
|
460
|
+
<span class="ruby-keyword">else</span>
|
461
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">snp_gt</span>
|
462
|
+
<span class="ruby-keyword">end</span>
|
463
|
+
<span class="ruby-keyword">end</span></pre>
|
464
|
+
</div>
|
465
|
+
|
466
|
+
</div>
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
</div>
|
472
|
+
|
473
|
+
|
474
|
+
<div id="method-i-non_ref_count" class="method-detail ">
|
475
|
+
|
476
|
+
<div class="method-heading">
|
477
|
+
<span class="method-name">non_ref_count</span><span
|
478
|
+
class="method-args">()</span>
|
479
|
+
|
480
|
+
<span class="method-click-advice">click to toggle source</span>
|
481
|
+
|
482
|
+
</div>
|
483
|
+
|
484
|
+
|
485
|
+
<div class="method-description">
|
486
|
+
|
487
|
+
<p>returns the total non-reference bases in the reads at this position</p>
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
<div class="method-source-code" id="non_ref_count-source">
|
493
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 69</span>
|
494
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">non_ref_count</span>
|
495
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@non_ref_count</span>.<span class="ruby-identifier">nil?</span>
|
496
|
+
<span class="ruby-ivar">@non_ref_count</span> = <span class="ruby-ivar">@read_bases</span>.<span class="ruby-identifier">count</span>(<span class="ruby-string">"ATGCatgc"</span>).<span class="ruby-identifier">to_f</span>
|
497
|
+
<span class="ruby-keyword">end</span>
|
498
|
+
<span class="ruby-ivar">@non_ref_count</span>
|
499
|
+
<span class="ruby-keyword">end</span></pre>
|
500
|
+
</div>
|
501
|
+
|
502
|
+
</div>
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
</div>
|
508
|
+
|
509
|
+
|
510
|
+
<div id="method-i-non_refs" class="method-detail ">
|
511
|
+
|
512
|
+
<div class="method-heading">
|
513
|
+
<span class="method-name">non_refs</span><span
|
514
|
+
class="method-args">()</span>
|
515
|
+
|
516
|
+
<span class="method-click-advice">click to toggle source</span>
|
517
|
+
|
518
|
+
</div>
|
519
|
+
|
520
|
+
|
521
|
+
<div class="method-description">
|
522
|
+
|
523
|
+
<p>Calculate the total count of each non-reference nucleotide and return a
|
524
|
+
hash of all 4 nt counts returns a hash pile.non_refs #{:A => 1, :C =>
|
525
|
+
0, :T => 0, :G => 0}</p>
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
<div class="method-source-code" id="non_refs-source">
|
531
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 61</span>
|
532
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">non_refs</span>
|
533
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@non_ref_count_hash</span>.<span class="ruby-identifier">nil?</span>
|
534
|
+
<span class="ruby-ivar">@non_ref_count_hash</span> = {<span class="ruby-value">:A</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">read_bases</span>.<span class="ruby-identifier">count</span>(<span class="ruby-string">"Aa"</span>), <span class="ruby-value">:C</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">read_bases</span>.<span class="ruby-identifier">count</span>(<span class="ruby-string">"Cc"</span>), <span class="ruby-value">:G</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">read_bases</span>.<span class="ruby-identifier">count</span>(<span class="ruby-string">"Gg"</span>), <span class="ruby-value">:T</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">read_bases</span>.<span class="ruby-identifier">count</span>(<span class="ruby-string">"Tt"</span>)}
|
535
|
+
<span class="ruby-keyword">end</span>
|
536
|
+
<span class="ruby-ivar">@non_ref_count_hash</span>
|
537
|
+
<span class="ruby-keyword">end</span></pre>
|
538
|
+
</div>
|
539
|
+
|
540
|
+
</div>
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
</div>
|
546
|
+
|
547
|
+
|
548
|
+
<div id="method-i-parse_indel" class="method-detail ">
|
549
|
+
|
550
|
+
<div class="method-heading">
|
551
|
+
<span class="method-name">parse_indel</span><span
|
552
|
+
class="method-args">(alt)</span>
|
553
|
+
|
554
|
+
<span class="method-click-advice">click to toggle source</span>
|
555
|
+
|
556
|
+
</div>
|
557
|
+
|
558
|
+
|
559
|
+
<div class="method-description">
|
560
|
+
|
561
|
+
<p>identifies if the indel is an insertion or a deletion</p>
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
<div class="method-source-code" id="parse_indel-source">
|
567
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 190</span>
|
568
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parse_indel</span>(<span class="ruby-identifier">alt</span>)
|
569
|
+
<span class="ruby-keyword">return</span> <span class="ruby-node">"D#{$'.length}"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">alt</span> <span class="ruby-operator">=~</span><span class="ruby-regexp">/^-/</span>
|
570
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">alt</span><span class="ruby-operator">=~</span><span class="ruby-regexp">/^\+/</span>
|
571
|
+
<span class="ruby-keyword">return</span> <span class="ruby-node">"I#{$'}"</span>
|
572
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">alt</span> <span class="ruby-operator">==</span> <span class="ruby-string">'*'</span>
|
573
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
|
574
|
+
<span class="ruby-keyword">end</span>
|
575
|
+
<span class="ruby-keyword">end</span></pre>
|
576
|
+
</div>
|
577
|
+
|
578
|
+
</div>
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
</div>
|
584
|
+
|
585
|
+
|
586
|
+
<div id="method-i-ref_count" class="method-detail ">
|
587
|
+
|
588
|
+
<div class="method-heading">
|
589
|
+
<span class="method-name">ref_count</span><span
|
590
|
+
class="method-args">()</span>
|
591
|
+
|
592
|
+
<span class="method-click-advice">click to toggle source</span>
|
593
|
+
|
594
|
+
</div>
|
595
|
+
|
596
|
+
|
597
|
+
<div class="method-description">
|
598
|
+
|
599
|
+
<p>returns the count of reference-bases in the reads at this position</p>
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
<div class="method-source-code" id="ref_count-source">
|
605
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 77</span>
|
606
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">ref_count</span>
|
607
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@ref_count</span>.<span class="ruby-identifier">nil?</span>
|
608
|
+
<span class="ruby-ivar">@ref_count</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">read_bases</span>.<span class="ruby-identifier">count</span>(<span class="ruby-string">".,"</span>)
|
609
|
+
<span class="ruby-keyword">end</span>
|
610
|
+
<span class="ruby-ivar">@ref_count</span>
|
611
|
+
<span class="ruby-keyword">end</span></pre>
|
612
|
+
</div>
|
613
|
+
|
614
|
+
</div>
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
</div>
|
620
|
+
|
621
|
+
|
622
|
+
<div id="method-i-to_s" class="method-detail ">
|
623
|
+
|
624
|
+
<div class="method-heading">
|
625
|
+
<span class="method-name">to_s</span><span
|
626
|
+
class="method-args">()</span>
|
627
|
+
|
628
|
+
<span class="method-click-advice">click to toggle source</span>
|
629
|
+
|
630
|
+
</div>
|
631
|
+
|
632
|
+
|
633
|
+
<div class="method-description">
|
634
|
+
|
635
|
+
<p>returns pileup format line</p>
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
<div class="method-source-code" id="to_s-source">
|
641
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 201</span>
|
642
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
643
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@read_quals</span> <span class="ruby-keyword">and</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@consensus_quality</span> <span class="ruby-comment">#6col</span>
|
644
|
+
[<span class="ruby-ivar">@ref_name</span>, <span class="ruby-ivar">@pos</span>, <span class="ruby-ivar">@ref_base</span>, <span class="ruby-ivar">@coverage</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@read_bases</span>, <span class="ruby-ivar">@read_quals</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">"\t"</span>)
|
645
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@indel_1</span> <span class="ruby-comment">#13 cols</span>
|
646
|
+
[<span class="ruby-ivar">@ref_name</span>, <span class="ruby-ivar">@pos</span>, <span class="ruby-ivar">@ref_base</span>, <span class="ruby-ivar">@consensus</span>, <span class="ruby-ivar">@consensus_quality</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@snp_quality</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@rms_mapq</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@coverage</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@indel_1</span>, <span class="ruby-ivar">@indel_2</span>, <span class="ruby-ivar">@ar1</span>, <span class="ruby-ivar">@ar2</span>, <span class="ruby-ivar">@ar3</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">"\t"</span>)
|
647
|
+
<span class="ruby-keyword">else</span> <span class="ruby-comment">#10 cols</span>
|
648
|
+
[<span class="ruby-ivar">@ref_name</span>, <span class="ruby-ivar">@pos</span>, <span class="ruby-ivar">@ref_base</span>, <span class="ruby-ivar">@consensus</span>, <span class="ruby-ivar">@consensus_quality</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@snp_quality</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@rms_mapq</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@coverage</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-ivar">@read_bases</span>, <span class="ruby-ivar">@read_quals</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">"\t"</span>)
|
649
|
+
<span class="ruby-keyword">end</span>
|
650
|
+
|
651
|
+
<span class="ruby-keyword">end</span></pre>
|
652
|
+
</div>
|
653
|
+
|
654
|
+
</div>
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
</div>
|
660
|
+
|
661
|
+
|
662
|
+
<div id="method-i-to_vcf" class="method-detail ">
|
663
|
+
|
664
|
+
<div class="method-heading">
|
665
|
+
<span class="method-name">to_vcf</span><span
|
666
|
+
class="method-args">()</span>
|
667
|
+
|
668
|
+
<span class="method-click-advice">click to toggle source</span>
|
669
|
+
|
670
|
+
</div>
|
671
|
+
|
672
|
+
|
673
|
+
<div class="method-description">
|
674
|
+
|
675
|
+
<p>returns basic VCF string as per samtools/misc sam2vcf.pl except that it
|
676
|
+
scrimps on the ref for indels, returning a '*' instead of the
|
677
|
+
reference allele</p>
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
<div class="method-source-code" id="to_vcf-source">
|
683
|
+
<pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 103</span>
|
684
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_vcf</span>
|
685
|
+
<span class="ruby-identifier">alt</span>,<span class="ruby-identifier">g</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">genotype_list</span>
|
686
|
+
<span class="ruby-identifier">alt</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">consensus</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">//</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">','</span>) <span class="ruby-keyword">unless</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref_base</span> <span class="ruby-operator">==</span> <span class="ruby-string">'*'</span>
|
687
|
+
<span class="ruby-identifier">alt</span> = <span class="ruby-string">'.'</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">alt</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref_base</span>
|
688
|
+
[<span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref_name</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pos</span>, <span class="ruby-string">'.'</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref_base</span>, <span class="ruby-identifier">alt</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">snp_quality</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-string">"0"</span>, <span class="ruby-node">"DP=#{self.coverage.to_i}"</span>, <span class="ruby-string">"GT:GQ:DP"</span>, <span class="ruby-node">"#{g}:#{self.consensus_quality.to_i}:#{self.coverage.to_i}"</span> ].<span class="ruby-identifier">join</span>(<span class="ruby-string">"\t"</span>)
|
689
|
+
<span class="ruby-keyword">end</span></pre>
|
690
|
+
</div>
|
691
|
+
|
692
|
+
</div>
|
693
|
+
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
</div>
|
698
|
+
|
699
|
+
|
700
|
+
</section>
|
701
|
+
|
702
|
+
</section>
|
703
|
+
</main>
|
704
|
+
|
705
|
+
|
706
|
+
<footer id="validator-badges" role="contentinfo">
|
707
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
708
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
709
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
710
|
+
</footer>
|
711
|
+
|