bio-samtools 0.6.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -2
  3. data/README.md +4 -7
  4. data/VERSION +1 -1
  5. data/bio-samtools.gemspec +47 -105
  6. data/doc/Bio.html +68 -131
  7. data/doc/Bio/DB.html +51 -111
  8. data/doc/Bio/DB/Alignment.html +135 -363
  9. data/doc/Bio/DB/Pileup.html +183 -170
  10. data/doc/Bio/DB/SAM.html +1396 -820
  11. data/doc/Bio/DB/SAM/Library.html +73 -123
  12. data/doc/Bio/DB/SAM/Tools.html +51 -273
  13. data/doc/Bio/DB/Tag.html +78 -124
  14. data/doc/Bio/DB/Vcf.html +111 -147
  15. data/doc/LICENSE_txt.html +113 -148
  16. data/doc/created.rid +9 -10
  17. data/doc/fonts.css +167 -0
  18. data/doc/fonts/Lato-Light.ttf +0 -0
  19. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  20. data/doc/fonts/Lato-Regular.ttf +0 -0
  21. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  22. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  23. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  24. data/doc/images/add.png +0 -0
  25. data/doc/images/arrow_up.png +0 -0
  26. data/doc/images/delete.png +0 -0
  27. data/doc/images/tag_blue.png +0 -0
  28. data/doc/index.html +48 -54
  29. data/doc/js/darkfish.js +9 -22
  30. data/doc/js/search.js +20 -5
  31. data/doc/js/search_index.js +1 -1
  32. data/doc/rdoc.css +255 -218
  33. data/doc/table_of_contents.html +256 -137
  34. data/ext/Rakefile +57 -0
  35. data/lib/bio-samtools.rb +7 -2
  36. data/lib/bio/BIOExtensions.rb +89 -0
  37. data/lib/bio/db/alignment.rb +59 -0
  38. data/lib/bio/db/fastadb.rb +255 -0
  39. data/lib/bio/db/pileup.rb +221 -172
  40. data/lib/bio/db/sam.rb +639 -589
  41. data/lib/bio/db/sam/{faidx.rb → faidx_old.rb} +0 -0
  42. data/lib/bio/db/vcf.rb +69 -68
  43. data/test/.gitignore +1 -0
  44. data/test/{test_basic.rb → old_test_basic.rb} +33 -1
  45. data/test/samples/small/dupes.bam +0 -0
  46. data/test/samples/small/dupes.sam +274 -0
  47. data/test/samples/small/map_for_reheader.sam +8 -0
  48. data/test/samples/small/map_to_merge1.bam +0 -0
  49. data/test/samples/small/map_to_merge1.bam.bai +0 -0
  50. data/test/samples/small/map_to_merge1.sam +8 -0
  51. data/test/samples/small/map_to_merge2.bam +0 -0
  52. data/test/samples/small/map_to_merge2.bam.bai +0 -0
  53. data/test/samples/small/map_to_merge2.sam +8 -0
  54. data/test/samples/small/no_md.sam +8 -0
  55. data/test/samples/small/test_chr.fasta.1.bt2 +0 -0
  56. data/test/samples/small/test_chr.fasta.2.bt2 +0 -0
  57. data/test/samples/small/test_chr.fasta.3.bt2 +0 -0
  58. data/test/samples/small/test_chr.fasta.4.bt2 +0 -0
  59. data/test/samples/small/test_chr.fasta.rev.1.bt2 +0 -0
  60. data/test/samples/small/test_chr.fasta.rev.2.bt2 +0 -0
  61. data/test/samples/small/test_cov.svg +273 -0
  62. data/test/samples/small/testu.bam.bai +0 -0
  63. data/test/svg +133 -0
  64. data/test/test_pileup.rb +84 -0
  65. data/test/test_sam.rb +331 -0
  66. data/test/test_vcf.rb +11 -0
  67. data/{doc → tutorial}/tutorial.html +0 -0
  68. data/{doc → tutorial}/tutorial.pdf +0 -0
  69. metadata +56 -114
  70. data/doc/Bio/DB/SAM/Tools/Bam1CoreT.html +0 -159
  71. data/doc/Bio/DB/SAM/Tools/Bam1T.html +0 -220
  72. data/doc/Bio/DB/SAM/Tools/BamHeaderT.html +0 -249
  73. data/doc/Bio/DB/SAM/Tools/BamPileup1T.html +0 -159
  74. data/doc/Bio/DB/SAM/Tools/SamfileT.html +0 -171
  75. data/doc/Bio/DB/SAM/Tools/SamfileTX.html +0 -159
  76. data/doc/Bio/DB/SAMException.html +0 -205
  77. data/doc/LibC.html +0 -155
  78. data/doc/Pileup.html +0 -571
  79. data/doc/Vcf.html +0 -473
  80. data/doc/basic_styles.css +0 -31
  81. data/doc/classes/Bio.html +0 -139
  82. data/doc/classes/Bio/DB.html +0 -137
  83. data/doc/classes/Bio/DB/Alignment.html +0 -441
  84. data/doc/classes/Bio/DB/Alignment.src/M000012.html +0 -19
  85. data/doc/classes/Bio/DB/Alignment.src/M000013.html +0 -27
  86. data/doc/classes/Bio/DB/Alignment.src/M000014.html +0 -45
  87. data/doc/classes/Bio/DB/Alignment.src/M000015.html +0 -40
  88. data/doc/classes/Bio/DB/SAM.html +0 -510
  89. data/doc/classes/Bio/DB/SAM/Library.html +0 -135
  90. data/doc/classes/Bio/DB/SAM/Library.src/M000006.html +0 -28
  91. data/doc/classes/Bio/DB/SAM/Tools.html +0 -278
  92. data/doc/classes/Bio/DB/SAM/Tools.src/M000007.html +0 -20
  93. data/doc/classes/Bio/DB/SAM/Tools/Bam1CoreT.html +0 -111
  94. data/doc/classes/Bio/DB/SAM/Tools/Bam1T.html +0 -150
  95. data/doc/classes/Bio/DB/SAM/Tools/Bam1T.src/M000010.html +0 -20
  96. data/doc/classes/Bio/DB/SAM/Tools/BamHeaderT.html +0 -169
  97. data/doc/classes/Bio/DB/SAM/Tools/BamHeaderT.src/M000008.html +0 -19
  98. data/doc/classes/Bio/DB/SAM/Tools/BamHeaderT.src/M000009.html +0 -18
  99. data/doc/classes/Bio/DB/SAM/Tools/BamPileup1T.html +0 -111
  100. data/doc/classes/Bio/DB/SAM/Tools/SamfileT.html +0 -129
  101. data/doc/classes/Bio/DB/SAM/Tools/SamfileTX.html +0 -111
  102. data/doc/classes/Bio/DB/SAMException.html +0 -140
  103. data/doc/classes/Bio/DB/SAMException.src/M000016.html +0 -18
  104. data/doc/classes/Bio/DB/Sam.src/M000017.html +0 -43
  105. data/doc/classes/Bio/DB/Sam.src/M000018.html +0 -42
  106. data/doc/classes/Bio/DB/Sam.src/M000019.html +0 -18
  107. data/doc/classes/Bio/DB/Sam.src/M000020.html +0 -22
  108. data/doc/classes/Bio/DB/Sam.src/M000021.html +0 -19
  109. data/doc/classes/Bio/DB/Sam.src/M000022.html +0 -25
  110. data/doc/classes/Bio/DB/Sam.src/M000023.html +0 -28
  111. data/doc/classes/Bio/DB/Sam.src/M000024.html +0 -28
  112. data/doc/classes/Bio/DB/Sam.src/M000025.html +0 -46
  113. data/doc/classes/Bio/DB/Sam.src/M000026.html +0 -24
  114. data/doc/classes/Bio/DB/Sam.src/M000027.html +0 -19
  115. data/doc/classes/Bio/DB/Sam.src/M000028.html +0 -24
  116. data/doc/classes/Bio/DB/Sam.src/M000029.html +0 -41
  117. data/doc/classes/Bio/DB/Sam.src/M000030.html +0 -31
  118. data/doc/classes/Bio/DB/Sam.src/M000031.html +0 -86
  119. data/doc/classes/Bio/DB/Sam.src/M000032.html +0 -34
  120. data/doc/classes/Bio/DB/Tag.html +0 -160
  121. data/doc/classes/Bio/DB/Tag.src/M000011.html +0 -21
  122. data/doc/classes/LibC.html +0 -105
  123. data/doc/classes/Pileup.html +0 -374
  124. data/doc/classes/Pileup.src/M000001.html +0 -34
  125. data/doc/classes/Pileup.src/M000002.html +0 -21
  126. data/doc/classes/Pileup.src/M000003.html +0 -21
  127. data/doc/classes/Pileup.src/M000004.html +0 -21
  128. data/doc/classes/Pileup.src/M000005.html +0 -31
  129. data/doc/files/lib/bio-samtools_rb.html +0 -109
  130. data/doc/files/lib/bio/db/sam/bam_rb.html +0 -108
  131. data/doc/files/lib/bio/db/sam/faidx_rb.html +0 -108
  132. data/doc/files/lib/bio/db/sam/library_rb.html +0 -101
  133. data/doc/files/lib/bio/db/sam/pileup_rb.html +0 -178
  134. data/doc/files/lib/bio/db/sam/sam_rb.html +0 -113
  135. data/doc/files/lib/bio/db/sam_rb.html +0 -111
  136. data/doc/fr_class_index.html +0 -43
  137. data/doc/fr_file_index.html +0 -33
  138. data/doc/fr_method_index.html +0 -58
  139. data/doc/lib/bio-samtools_rb.html +0 -115
  140. data/doc/lib/bio/db/pileup_rb.html +0 -171
  141. data/doc/lib/bio/db/sam/bam_rb.html +0 -121
  142. data/doc/lib/bio/db/sam/faidx_rb.html +0 -117
  143. data/doc/lib/bio/db/sam/library_rb.html +0 -115
  144. data/doc/lib/bio/db/sam/pileup_rb.html +0 -171
  145. data/doc/lib/bio/db/sam/sam_rb.html +0 -121
  146. data/doc/lib/bio/db/sam/vcf_rb.html +0 -124
  147. data/doc/lib/bio/db/sam_rb.html +0 -115
  148. data/doc/lib/bio/db/vcf_rb.html +0 -124
  149. data/doc/rdoc-style.css +0 -208
  150. data/lib/bio/db/sam/bam.rb +0 -210
  151. data/lib/bio/db/sam/sam.rb +0 -86
  152. data/test/samples/pipe_char/test.bam +0 -0
  153. data/test/samples/pipe_char/test.bam.bai +0 -0
  154. data/test/samples/pipe_char/test.tam +0 -10
  155. data/test/samples/pipe_char/test_chr.fasta +0 -1000
  156. data/test/samples/pipe_char/test_chr.fasta.fai +0 -1
  157. data/test/samples/small/test +0 -0
  158. data/test/samples/small/test.bam +0 -0
  159. data/test/samples/small/test.fa +0 -20
  160. data/test/samples/small/test.fai +0 -0
@@ -2,159 +2,109 @@
2
2
 
3
3
  <html>
4
4
  <head>
5
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
5
+ <meta charset="UTF-8">
6
6
 
7
7
  <title>class Bio::DB::Pileup - Pileup</title>
8
8
 
9
- <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
9
+ <link href="../../fonts.css" rel="stylesheet">
10
+ <link href="../../rdoc.css" rel="stylesheet">
10
11
 
11
12
  <script type="text/javascript">
12
13
  var rdoc_rel_prefix = "../../";
13
14
  </script>
14
15
 
15
- <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
16
- <script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
17
- <script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
18
- <script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
19
- <script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
20
- <script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
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>
21
22
 
22
23
 
23
- <body id="top" class="class">
24
- <nav id="metadata">
25
- <nav id="home-section" class="section">
26
- <h3 class="section-header">
27
- <a href="../../index.html">Home</a>
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>
28
34
  <a href="../../table_of_contents.html#classes">Classes</a>
29
35
  <a href="../../table_of_contents.html#methods">Methods</a>
30
- </h3>
31
- </nav>
32
-
36
+ </div>
37
+ </div>
33
38
 
34
- <nav id="search-section" class="section project-section" class="initially-hidden">
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
35
40
  <form action="#" method="get" accept-charset="utf-8">
36
- <h3 class="section-header">
37
- <input type="text" name="search" placeholder="Search" id="search-field"
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"
38
45
  title="Type to search, Up and Down to navigate, Enter to load">
39
- </h3>
40
- </form>
41
-
42
- <ul id="search-results" class="initially-hidden"></ul>
43
- </nav>
46
+ </div>
44
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>
45
53
 
46
- <div id="file-metadata">
47
- <nav id="file-list-section" class="section">
48
- <h3 class="section-header">Defined In</h3>
49
- <ul>
50
- <li>lib/bio/db/pileup.rb
51
- </ul>
52
- </nav>
53
-
54
-
55
54
  </div>
56
55
 
56
+
57
+
57
58
  <div id="class-metadata">
58
59
 
59
- <nav id="parent-class-section" class="section">
60
- <h3 class="section-header">Parent</h3>
60
+ <div id="parent-class-section" class="nav-section">
61
+ <h3>Parent</h3>
62
+
61
63
 
62
64
  <p class="link">Object
63
65
 
64
- </nav>
66
+ </div>
65
67
 
66
68
 
69
+
67
70
  <!-- Method Quickref -->
68
- <nav id="method-list-section" class="section">
69
- <h3 class="section-header">Methods</h3>
71
+ <div id="method-list-section" class="nav-section">
72
+ <h3>Methods</h3>
70
73
 
71
- <ul class="link-list">
74
+ <ul class="link-list" role="directory">
72
75
 
73
- <li><a href="#method-c-iupac_to_base">::iupac_to_base</a>
76
+ <li ><a href="#method-c-iupac_to_base">::iupac_to_base</a>
74
77
 
75
- <li><a href="#method-c-new">::new</a>
78
+ <li ><a href="#method-c-new">::new</a>
76
79
 
77
- <li><a href="#method-i-genotype_list">#genotype_list</a>
80
+ <li ><a href="#method-i-genotype_list">#genotype_list</a>
78
81
 
79
- <li><a href="#method-i-non_ref_count">#non_ref_count</a>
82
+ <li ><a href="#method-i-non_ref_count">#non_ref_count</a>
80
83
 
81
- <li><a href="#method-i-non_refs">#non_refs</a>
84
+ <li ><a href="#method-i-non_refs">#non_refs</a>
82
85
 
83
- <li><a href="#method-i-ref_count">#ref_count</a>
86
+ <li ><a href="#method-i-parse_indel">#parse_indel</a>
84
87
 
85
- <li><a href="#method-i-to_s">#to_s</a>
88
+ <li ><a href="#method-i-ref_count">#ref_count</a>
86
89
 
87
- <li><a href="#method-i-to_vcf">#to_vcf</a>
90
+ <li ><a href="#method-i-to_s">#to_s</a>
91
+
92
+ <li ><a href="#method-i-to_vcf">#to_vcf</a>
88
93
 
89
94
  </ul>
90
- </nav>
91
-
92
- </div>
93
-
94
- <div id="project-metadata">
95
- <nav id="fileindex-section" class="section project-section">
96
- <h3 class="section-header">Pages</h3>
97
-
98
- <ul>
99
-
100
- <li class="file"><a href="../../LICENSE_txt.html">LICENSE</a>
101
-
102
- </ul>
103
- </nav>
104
-
105
- <nav id="classindex-section" class="section project-section">
106
- <h3 class="section-header">Class and Module Index</h3>
107
-
108
- <ul class="link-list">
109
-
110
- <li><a href="../../Bio.html">Bio</a>
111
-
112
- <li><a href="../../Bio/DB.html">Bio::DB</a>
113
-
114
- <li><a href="../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
115
-
116
- <li><a href="../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
117
-
118
- <li><a href="../../Bio/DB/SAM.html">Bio::DB::SAM</a>
119
-
120
- <li><a href="../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
121
-
122
- <li><a href="../../Bio/DB/SAM/Tools.html">Bio::DB::SAM::Tools</a>
123
-
124
- <li><a href="../../Bio/DB/SAM/Tools/Bam1CoreT.html">Bio::DB::SAM::Tools::Bam1CoreT</a>
125
-
126
- <li><a href="../../Bio/DB/SAM/Tools/Bam1T.html">Bio::DB::SAM::Tools::Bam1T</a>
127
-
128
- <li><a href="../../Bio/DB/SAM/Tools/BamHeaderT.html">Bio::DB::SAM::Tools::BamHeaderT</a>
129
-
130
- <li><a href="../../Bio/DB/SAM/Tools/BamPileup1T.html">Bio::DB::SAM::Tools::BamPileup1T</a>
131
-
132
- <li><a href="../../Bio/DB/SAM/Tools/SamfileT.html">Bio::DB::SAM::Tools::SamfileT</a>
133
-
134
- <li><a href="../../Bio/DB/SAM/Tools/SamfileTX.html">Bio::DB::SAM::Tools::SamfileTX</a>
135
-
136
- <li><a href="../../Bio/DB/SAMException.html">Bio::DB::SAMException</a>
137
-
138
- <li><a href="../../Bio/DB/Sam.html">Bio::DB::Sam</a>
139
-
140
- <li><a href="../../Bio/DB/Tag.html">Bio::DB::Tag</a>
141
-
142
- <li><a href="../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
143
-
144
- <li><a href="../../LibC.html">LibC</a>
145
-
146
- </ul>
147
- </nav>
95
+ </div>
148
96
 
149
97
  </div>
150
98
  </nav>
151
99
 
152
- <div id="documentation">
153
- <h1 class="class">class Bio::DB::Pileup</h1>
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>
154
104
 
155
- <div id="description" class="description">
105
+ <section class="description">
156
106
 
157
- </div><!-- description -->
107
+ </section>
158
108
 
159
109
 
160
110
 
@@ -167,9 +117,10 @@
167
117
 
168
118
 
169
119
 
170
- <!-- Attributes -->
171
- <section id="attribute-method-details" class="method-section section">
172
- <h3 class="section-header">Attributes</h3>
120
+ <section class="attribute-method-details" class="method-section">
121
+ <header>
122
+ <h3>Attributes</h3>
123
+ </header>
173
124
 
174
125
 
175
126
  <div id="attribute-i-ar1" class="method-detail">
@@ -367,13 +318,14 @@
367
318
  </div>
368
319
  </div>
369
320
 
370
- </section><!-- attribute-method-details -->
321
+ </section>
371
322
 
372
323
 
373
- <!-- Methods -->
374
324
 
375
- <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
376
- <h3 class="section-header">Public Class Methods</h3>
325
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
326
+ <header>
327
+ <h3>Public Class Methods</h3>
328
+ </header>
377
329
 
378
330
 
379
331
  <div id="method-c-iupac_to_base" class="method-detail ">
@@ -381,37 +333,40 @@
381
333
  <div class="method-heading">
382
334
  <span class="method-name">iupac_to_base</span><span
383
335
  class="method-args">(alt_base)</span>
336
+
384
337
  <span class="method-click-advice">click to toggle source</span>
338
+
385
339
  </div>
386
340
 
387
341
 
388
342
  <div class="method-description">
389
343
 
390
- <p>returns</p>
344
+ <p>returns the two bases for the corresponding iupac code</p>
345
+
391
346
 
392
347
 
393
348
 
394
349
  <div class="method-source-code" id="iupac_to_base-source">
395
- <pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 184</span>
350
+ <pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 177</span>
396
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>)
397
352
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">alt_base</span>
398
- <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>]
399
- <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>]
400
- <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>]
401
- <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>]
402
- <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>]
403
- <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>]
404
- <span class="ruby-keyword">else</span> <span class="ruby-identifier">alt_base</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">%r/</span>)
353
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;K&#39;</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">&#39;G&#39;</span>,<span class="ruby-string">&#39;T&#39;</span>]
354
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;M&#39;</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">&#39;A&#39;</span>,<span class="ruby-string">&#39;C&#39;</span>]
355
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;S&#39;</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">&#39;C&#39;</span>,<span class="ruby-string">&#39;G&#39;</span>]
356
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;R&#39;</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">&#39;A&#39;</span>,<span class="ruby-string">&#39;G&#39;</span>]
357
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;W&#39;</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">&#39;A&#39;</span>,<span class="ruby-string">&#39;T&#39;</span>]
358
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;Y&#39;</span> <span class="ruby-keyword">then</span> [<span class="ruby-string">&#39;C&#39;</span>,<span class="ruby-string">&#39;T&#39;</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>)
405
360
  <span class="ruby-keyword">end</span>
406
361
  <span class="ruby-keyword">end</span></pre>
407
- </div><!-- iupac_to_base-source -->
362
+ </div>
408
363
 
409
364
  </div>
410
365
 
411
366
 
412
367
 
413
368
 
414
- </div><!-- iupac_to_base-method -->
369
+ </div>
415
370
 
416
371
 
417
372
  <div id="method-c-new" class="method-detail ">
@@ -419,7 +374,9 @@
419
374
  <div class="method-heading">
420
375
  <span class="method-name">new</span><span
421
376
  class="method-args">(pile_up_line)</span>
377
+
422
378
  <span class="method-click-advice">click to toggle source</span>
379
+
423
380
  </div>
424
381
 
425
382
 
@@ -430,16 +387,17 @@
430
387
  <pre>pile_up_line = &quot;seq2\t151\tG\tG\t36\t0\t99\t12\t...........A\t:9&lt;;;7=&lt;&lt;&lt;&lt;&lt;&quot;
431
388
  pile = Bio::DB::Pileup.new(pile_up_line)</pre>
432
389
 
390
+
433
391
 
434
392
 
435
393
  <div class="method-source-code" id="new-source">
436
394
  <pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 35</span>
437
395
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">pile_up_line</span>)
438
- <span class="ruby-identifier">cols</span> = <span class="ruby-identifier">pile_up_line</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">%r\t/</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>)
439
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>
440
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>
441
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>
442
- <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>
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">&#39;*&#39;</span> <span class="ruby-comment">#indel</span>
443
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>
444
402
  <span class="ruby-keyword">else</span> <span class="ruby-comment">#snp / identity</span>
445
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>
@@ -448,7 +406,7 @@ pile = Bio::DB::Pileup.new(pile_up_line)</pre>
448
406
  <span class="ruby-ivar">@snp_quality</span> = <span class="ruby-ivar">@snp_quality</span>.<span class="ruby-identifier">to_f</span>
449
407
  <span class="ruby-ivar">@rms_mapq</span> = <span class="ruby-ivar">@rms_mapq</span>.<span class="ruby-identifier">to_f</span>
450
408
  <span class="ruby-keyword">else</span>
451
- <span class="ruby-comment">#raise RuntimeError, &quot;parsing line '#{pile_up_line.chomp}' failed&quot;</span>
409
+ <span class="ruby-comment">#raise RuntimeError, &quot;parsing line &#39;#{pile_up_line.chomp}&#39; failed&quot;</span>
452
410
  <span class="ruby-keyword">end</span>
453
411
 
454
412
  <span class="ruby-ivar">@pos</span> = <span class="ruby-ivar">@pos</span>.<span class="ruby-identifier">to_i</span>
@@ -457,20 +415,22 @@ pile = Bio::DB::Pileup.new(pile_up_line)</pre>
457
415
  <span class="ruby-ivar">@non_ref_count_hash</span> = <span class="ruby-keyword">nil</span>
458
416
  <span class="ruby-ivar">@non_ref_count</span> = <span class="ruby-keyword">nil</span>
459
417
  <span class="ruby-keyword">end</span></pre>
460
- </div><!-- new-source -->
418
+ </div>
461
419
 
462
420
  </div>
463
421
 
464
422
 
465
423
 
466
424
 
467
- </div><!-- new-method -->
425
+ </div>
468
426
 
469
427
 
470
- </section><!-- public-class-method-details -->
428
+ </section>
471
429
 
472
- <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
473
- <h3 class="section-header">Public Instance Methods</h3>
430
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
431
+ <header>
432
+ <h3>Public Instance Methods</h3>
433
+ </header>
474
434
 
475
435
 
476
436
  <div id="method-i-genotype_list" class="method-detail ">
@@ -478,33 +438,37 @@ pile = Bio::DB::Pileup.new(pile_up_line)</pre>
478
438
  <div class="method-heading">
479
439
  <span class="method-name">genotype_list</span><span
480
440
  class="method-args">()</span>
441
+
481
442
  <span class="method-click-advice">click to toggle source</span>
443
+
482
444
  </div>
483
445
 
484
446
 
485
447
  <div class="method-description">
486
448
 
449
+ <p>identifies the reference base and returns the indel or snp genotype as
450
+ applicable</p>
487
451
 
488
452
 
489
453
 
490
454
 
491
455
  <div class="method-source-code" id="genotype_list-source">
492
- <pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 174</span>
456
+ <pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 167</span>
493
457
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">genotype_list</span>
494
- <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>
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">&#39;*&#39;</span>
495
459
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">indel_gt</span>
496
460
  <span class="ruby-keyword">else</span>
497
461
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">snp_gt</span>
498
- <span class="ruby-keyword">end</span>
462
+ <span class="ruby-keyword">end</span>
499
463
  <span class="ruby-keyword">end</span></pre>
500
- </div><!-- genotype_list-source -->
464
+ </div>
501
465
 
502
466
  </div>
503
467
 
504
468
 
505
469
 
506
470
 
507
- </div><!-- genotype_list-method -->
471
+ </div>
508
472
 
509
473
 
510
474
  <div id="method-i-non_ref_count" class="method-detail ">
@@ -512,7 +476,9 @@ pile = Bio::DB::Pileup.new(pile_up_line)</pre>
512
476
  <div class="method-heading">
513
477
  <span class="method-name">non_ref_count</span><span
514
478
  class="method-args">()</span>
479
+
515
480
  <span class="method-click-advice">click to toggle source</span>
481
+
516
482
  </div>
517
483
 
518
484
 
@@ -520,6 +486,7 @@ pile = Bio::DB::Pileup.new(pile_up_line)</pre>
520
486
 
521
487
  <p>returns the total non-reference bases in the reads at this position</p>
522
488
 
489
+
523
490
 
524
491
 
525
492
  <div class="method-source-code" id="non_ref_count-source">
@@ -530,14 +497,14 @@ pile = Bio::DB::Pileup.new(pile_up_line)</pre>
530
497
  <span class="ruby-keyword">end</span>
531
498
  <span class="ruby-ivar">@non_ref_count</span>
532
499
  <span class="ruby-keyword">end</span></pre>
533
- </div><!-- non_ref_count-source -->
500
+ </div>
534
501
 
535
502
  </div>
536
503
 
537
504
 
538
505
 
539
506
 
540
- </div><!-- non_ref_count-method -->
507
+ </div>
541
508
 
542
509
 
543
510
  <div id="method-i-non_refs" class="method-detail ">
@@ -545,17 +512,18 @@ pile = Bio::DB::Pileup.new(pile_up_line)</pre>
545
512
  <div class="method-heading">
546
513
  <span class="method-name">non_refs</span><span
547
514
  class="method-args">()</span>
515
+
548
516
  <span class="method-click-advice">click to toggle source</span>
517
+
549
518
  </div>
550
519
 
551
520
 
552
521
  <div class="method-description">
553
522
 
554
523
  <p>Calculate the total count of each non-reference nucleotide and return a
555
- hash of all 4 nt counts, returns a hash</p>
556
-
557
- <pre class="ruby"><span class="ruby-identifier">pile</span>.<span class="ruby-identifier">non_refs</span> <span class="ruby-comment">#{:A =&gt; 1, :C =&gt; 0, :T =&gt; 0, :G =&gt; 0}</span>
558
- </pre>
524
+ hash of all 4 nt counts returns a hash pile.non_refs #{:A =&gt; 1, :C =&gt;
525
+ 0, :T =&gt; 0, :G =&gt; 0}</p>
526
+
559
527
 
560
528
 
561
529
 
@@ -567,14 +535,52 @@ hash of all 4 nt counts, returns a hash</p>
567
535
  <span class="ruby-keyword">end</span>
568
536
  <span class="ruby-ivar">@non_ref_count_hash</span>
569
537
  <span class="ruby-keyword">end</span></pre>
570
- </div><!-- non_refs-source -->
538
+ </div>
571
539
 
572
540
  </div>
573
541
 
574
542
 
575
543
 
576
544
 
577
- </div><!-- non_refs-method -->
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">&quot;D#{$&#39;.length}&quot;</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">&quot;I#{$&#39;}&quot;</span>
572
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">alt</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;*&#39;</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>
578
584
 
579
585
 
580
586
  <div id="method-i-ref_count" class="method-detail ">
@@ -582,7 +588,9 @@ hash of all 4 nt counts, returns a hash</p>
582
588
  <div class="method-heading">
583
589
  <span class="method-name">ref_count</span><span
584
590
  class="method-args">()</span>
591
+
585
592
  <span class="method-click-advice">click to toggle source</span>
593
+
586
594
  </div>
587
595
 
588
596
 
@@ -590,6 +598,7 @@ hash of all 4 nt counts, returns a hash</p>
590
598
 
591
599
  <p>returns the count of reference-bases in the reads at this position</p>
592
600
 
601
+
593
602
 
594
603
 
595
604
  <div class="method-source-code" id="ref_count-source">
@@ -600,14 +609,14 @@ hash of all 4 nt counts, returns a hash</p>
600
609
  <span class="ruby-keyword">end</span>
601
610
  <span class="ruby-ivar">@ref_count</span>
602
611
  <span class="ruby-keyword">end</span></pre>
603
- </div><!-- ref_count-source -->
612
+ </div>
604
613
 
605
614
  </div>
606
615
 
607
616
 
608
617
 
609
618
 
610
- </div><!-- ref_count-method -->
619
+ </div>
611
620
 
612
621
 
613
622
  <div id="method-i-to_s" class="method-detail ">
@@ -615,18 +624,21 @@ hash of all 4 nt counts, returns a hash</p>
615
624
  <div class="method-heading">
616
625
  <span class="method-name">to_s</span><span
617
626
  class="method-args">()</span>
627
+
618
628
  <span class="method-click-advice">click to toggle source</span>
629
+
619
630
  </div>
620
631
 
621
632
 
622
633
  <div class="method-description">
623
634
 
624
- <p>returns pileup format line as</p>
635
+ <p>returns pileup format line</p>
636
+
625
637
 
626
638
 
627
639
 
628
640
  <div class="method-source-code" id="to_s-source">
629
- <pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 197</span>
641
+ <pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 201</span>
630
642
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
631
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>
632
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">&quot;\t&quot;</span>)
@@ -637,14 +649,14 @@ hash of all 4 nt counts, returns a hash</p>
637
649
  <span class="ruby-keyword">end</span>
638
650
 
639
651
  <span class="ruby-keyword">end</span></pre>
640
- </div><!-- to_s-source -->
652
+ </div>
641
653
 
642
654
  </div>
643
655
 
644
656
 
645
657
 
646
658
 
647
- </div><!-- to_s-method -->
659
+ </div>
648
660
 
649
661
 
650
662
  <div id="method-i-to_vcf" class="method-detail ">
@@ -652,47 +664,48 @@ hash of all 4 nt counts, returns a hash</p>
652
664
  <div class="method-heading">
653
665
  <span class="method-name">to_vcf</span><span
654
666
  class="method-args">()</span>
667
+
655
668
  <span class="method-click-advice">click to toggle source</span>
669
+
656
670
  </div>
657
671
 
658
672
 
659
673
  <div class="method-description">
660
674
 
661
675
  <p>returns basic VCF string as per samtools/misc sam2vcf.pl except that it
662
- scrimps on the ref for indels, returning a ‘*’ instead of the reference
663
- allele</p>
676
+ scrimps on the ref for indels, returning a &#39;*&#39; instead of the
677
+ reference allele</p>
678
+
664
679
 
665
680
 
666
681
 
667
682
  <div class="method-source-code" id="to_vcf-source">
668
683
  <pre><span class="ruby-comment"># File lib/bio/db/pileup.rb, line 103</span>
669
684
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_vcf</span>
670
-
671
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>
672
- <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">%r/</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>
673
- <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>
674
- [<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">&quot;0&quot;</span>, <span class="ruby-node">&quot;DP=#{self.coverage.to_i}&quot;</span>, <span class="ruby-string">&quot;GT:GQ:DP&quot;</span>, <span class="ruby-node">&quot;#{g}:#{self.consensus_quality.to_i}:#{self.coverage.to_i}&quot;</span> ].<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\t&quot;</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">&#39;,&#39;</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">&#39;*&#39;</span>
687
+ <span class="ruby-identifier">alt</span> = <span class="ruby-string">&#39;.&#39;</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">&#39;.&#39;</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">&quot;0&quot;</span>, <span class="ruby-node">&quot;DP=#{self.coverage.to_i}&quot;</span>, <span class="ruby-string">&quot;GT:GQ:DP&quot;</span>, <span class="ruby-node">&quot;#{g}:#{self.consensus_quality.to_i}:#{self.coverage.to_i}&quot;</span> ].<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\t&quot;</span>)
675
689
  <span class="ruby-keyword">end</span></pre>
676
- </div><!-- to_vcf-source -->
690
+ </div>
677
691
 
678
692
  </div>
679
693
 
680
694
 
681
695
 
682
696
 
683
- </div><!-- to_vcf-method -->
697
+ </div>
684
698
 
685
699
 
686
- </section><!-- public-instance-method-details -->
700
+ </section>
687
701
 
688
- </section><!-- 5Buntitled-5D -->
689
-
690
- </div><!-- documentation -->
702
+ </section>
703
+ </main>
691
704
 
692
705
 
693
- <footer id="validator-badges">
694
- <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
695
- <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
696
- <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
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>.
697
710
  </footer>
698
711