bio-samtools 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/Gemfile.lock +1 -0
  2. data/README.rdoc +1 -0
  3. data/VERSION +1 -1
  4. data/bio-samtools.gemspec +19 -19
  5. data/doc/Bio.html +71 -4
  6. data/doc/Bio/DB.html +6 -4
  7. data/doc/Bio/DB/Alignment.html +8 -8
  8. data/doc/Bio/DB/Pileup.html +515 -0
  9. data/doc/Bio/DB/SAM.html +37 -37
  10. data/doc/Bio/DB/SAM/Library.html +4 -4
  11. data/doc/Bio/DB/SAM/Tools.html +4 -4
  12. data/doc/Bio/DB/SAM/Tools/Bam1CoreT.html +4 -4
  13. data/doc/Bio/DB/SAM/Tools/Bam1T.html +4 -4
  14. data/doc/Bio/DB/SAM/Tools/BamHeaderT.html +4 -4
  15. data/doc/Bio/DB/SAM/Tools/BamPileup1T.html +4 -4
  16. data/doc/Bio/DB/SAM/Tools/SamfileT.html +4 -4
  17. data/doc/Bio/DB/SAM/Tools/SamfileTX.html +4 -4
  18. data/doc/Bio/DB/SAMException.html +5 -5
  19. data/doc/Bio/DB/Tag.html +5 -5
  20. data/doc/Bio/DB/Vcf.html +467 -0
  21. data/doc/LICENSE_txt.html +57 -60
  22. data/doc/LibC.html +6 -4
  23. data/doc/created.rid +7 -7
  24. data/doc/index.html +4 -4
  25. data/doc/js/search_index.js +1 -1
  26. data/doc/lib/bio-samtools_rb.html +4 -4
  27. data/doc/lib/bio/db/pileup_rb.html +171 -0
  28. data/doc/lib/bio/db/sam/bam_rb.html +4 -4
  29. data/doc/lib/bio/db/sam/faidx_rb.html +4 -4
  30. data/doc/lib/bio/db/sam/library_rb.html +4 -4
  31. data/doc/lib/bio/db/sam/sam_rb.html +4 -4
  32. data/doc/lib/bio/db/sam_rb.html +4 -4
  33. data/doc/lib/bio/db/vcf_rb.html +124 -0
  34. data/doc/table_of_contents.html +16 -26
  35. data/doc/tutorial.html +26 -1
  36. data/doc/tutorial.pdf +0 -0
  37. data/lib/bio/db/{sam/pileup.rb → pileup.rb} +6 -4
  38. data/lib/bio/db/sam.rb +13 -12
  39. data/lib/bio/db/{sam/vcf.rb → vcf.rb} +6 -2
  40. data/test/samples/small/sorted.bam.bai +0 -0
  41. data/test/test_basic.rb +7 -5
  42. data/test/test_vcf.rb +5 -5
  43. metadata +29 -26
  44. data/test/basictest.rb +0 -322
  45. data/test/pileup.rb +0 -68
@@ -65,6 +65,8 @@
65
65
 
66
66
  <li><a href="../../../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
67
67
 
68
+ <li><a href="../../../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
69
+
68
70
  <li><a href="../../../../Bio/DB/SAM.html">Bio::DB::SAM</a>
69
71
 
70
72
  <li><a href="../../../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
@@ -89,11 +91,9 @@
89
91
 
90
92
  <li><a href="../../../../Bio/DB/Tag.html">Bio::DB::Tag</a>
91
93
 
92
- <li><a href="../../../../LibC.html">LibC</a>
93
-
94
- <li><a href="../../../../Pileup.html">Pileup</a>
94
+ <li><a href="../../../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
95
95
 
96
- <li><a href="../../../../Vcf.html">Vcf</a>
96
+ <li><a href="../../../../LibC.html">LibC</a>
97
97
 
98
98
  </ul>
99
99
  </nav>
@@ -65,6 +65,8 @@
65
65
 
66
66
  <li><a href="../../../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
67
67
 
68
+ <li><a href="../../../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
69
+
68
70
  <li><a href="../../../../Bio/DB/SAM.html">Bio::DB::SAM</a>
69
71
 
70
72
  <li><a href="../../../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
@@ -89,11 +91,9 @@
89
91
 
90
92
  <li><a href="../../../../Bio/DB/Tag.html">Bio::DB::Tag</a>
91
93
 
92
- <li><a href="../../../../LibC.html">LibC</a>
93
-
94
- <li><a href="../../../../Pileup.html">Pileup</a>
94
+ <li><a href="../../../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
95
95
 
96
- <li><a href="../../../../Vcf.html">Vcf</a>
96
+ <li><a href="../../../../LibC.html">LibC</a>
97
97
 
98
98
  </ul>
99
99
  </nav>
@@ -65,6 +65,8 @@
65
65
 
66
66
  <li><a href="../../../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
67
67
 
68
+ <li><a href="../../../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
69
+
68
70
  <li><a href="../../../../Bio/DB/SAM.html">Bio::DB::SAM</a>
69
71
 
70
72
  <li><a href="../../../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
@@ -89,11 +91,9 @@
89
91
 
90
92
  <li><a href="../../../../Bio/DB/Tag.html">Bio::DB::Tag</a>
91
93
 
92
- <li><a href="../../../../LibC.html">LibC</a>
93
-
94
- <li><a href="../../../../Pileup.html">Pileup</a>
94
+ <li><a href="../../../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
95
95
 
96
- <li><a href="../../../../Vcf.html">Vcf</a>
96
+ <li><a href="../../../../LibC.html">LibC</a>
97
97
 
98
98
  </ul>
99
99
  </nav>
@@ -65,6 +65,8 @@
65
65
 
66
66
  <li><a href="../../../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
67
67
 
68
+ <li><a href="../../../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
69
+
68
70
  <li><a href="../../../../Bio/DB/SAM.html">Bio::DB::SAM</a>
69
71
 
70
72
  <li><a href="../../../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
@@ -89,11 +91,9 @@
89
91
 
90
92
  <li><a href="../../../../Bio/DB/Tag.html">Bio::DB::Tag</a>
91
93
 
92
- <li><a href="../../../../LibC.html">LibC</a>
93
-
94
- <li><a href="../../../../Pileup.html">Pileup</a>
94
+ <li><a href="../../../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
95
95
 
96
- <li><a href="../../../../Vcf.html">Vcf</a>
96
+ <li><a href="../../../../LibC.html">LibC</a>
97
97
 
98
98
  </ul>
99
99
  </nav>
@@ -65,6 +65,8 @@
65
65
 
66
66
  <li><a href="../../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
67
67
 
68
+ <li><a href="../../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
69
+
68
70
  <li><a href="../../../Bio/DB/SAM.html">Bio::DB::SAM</a>
69
71
 
70
72
  <li><a href="../../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
@@ -89,11 +91,9 @@
89
91
 
90
92
  <li><a href="../../../Bio/DB/Tag.html">Bio::DB::Tag</a>
91
93
 
92
- <li><a href="../../../LibC.html">LibC</a>
93
-
94
- <li><a href="../../../Pileup.html">Pileup</a>
94
+ <li><a href="../../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
95
95
 
96
- <li><a href="../../../Vcf.html">Vcf</a>
96
+ <li><a href="../../../LibC.html">LibC</a>
97
97
 
98
98
  </ul>
99
99
  </nav>
@@ -0,0 +1,124 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>LICENSE</title>
8
+
9
+ <link type="text/css" media="screen" href="../../../rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "../../../";
13
+ </script>
14
+
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>
21
+
22
+
23
+ <body class="file">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="../../../index.html">Home</a>
28
+ <a href="../../../table_of_contents.html#classes">Classes</a>
29
+ <a href="../../../table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ 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>
44
+
45
+
46
+ <div id="project-metadata">
47
+ <nav id="fileindex-section" class="section project-section">
48
+ <h3 class="section-header">Pages</h3>
49
+
50
+ <ul>
51
+
52
+ <li class="file"><a href="../../../LICENSE_txt.html">LICENSE</a>
53
+
54
+ </ul>
55
+ </nav>
56
+
57
+ <nav id="classindex-section" class="section project-section">
58
+ <h3 class="section-header">Class and Module Index</h3>
59
+
60
+ <ul class="link-list">
61
+
62
+ <li><a href="../../../Bio.html">Bio</a>
63
+
64
+ <li><a href="../../../Bio/DB.html">Bio::DB</a>
65
+
66
+ <li><a href="../../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
67
+
68
+ <li><a href="../../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
69
+
70
+ <li><a href="../../../Bio/DB/SAM.html">Bio::DB::SAM</a>
71
+
72
+ <li><a href="../../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
73
+
74
+ <li><a href="../../../Bio/DB/SAM/Tools.html">Bio::DB::SAM::Tools</a>
75
+
76
+ <li><a href="../../../Bio/DB/SAM/Tools/Bam1CoreT.html">Bio::DB::SAM::Tools::Bam1CoreT</a>
77
+
78
+ <li><a href="../../../Bio/DB/SAM/Tools/Bam1T.html">Bio::DB::SAM::Tools::Bam1T</a>
79
+
80
+ <li><a href="../../../Bio/DB/SAM/Tools/BamHeaderT.html">Bio::DB::SAM::Tools::BamHeaderT</a>
81
+
82
+ <li><a href="../../../Bio/DB/SAM/Tools/BamPileup1T.html">Bio::DB::SAM::Tools::BamPileup1T</a>
83
+
84
+ <li><a href="../../../Bio/DB/SAM/Tools/SamfileT.html">Bio::DB::SAM::Tools::SamfileT</a>
85
+
86
+ <li><a href="../../../Bio/DB/SAM/Tools/SamfileTX.html">Bio::DB::SAM::Tools::SamfileTX</a>
87
+
88
+ <li><a href="../../../Bio/DB/SAMException.html">Bio::DB::SAMException</a>
89
+
90
+ <li><a href="../../../Bio/DB/Sam.html">Bio::DB::Sam</a>
91
+
92
+ <li><a href="../../../Bio/DB/Tag.html">Bio::DB::Tag</a>
93
+
94
+ <li><a href="../../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
95
+
96
+ <li><a href="../../../LibC.html">LibC</a>
97
+
98
+ </ul>
99
+ </nav>
100
+
101
+ </div>
102
+ </nav>
103
+
104
+ <div id="documentation" class="description">
105
+
106
+ <h1 id="label-Vcf+">Vcf </h1>
107
+
108
+ <p>A class representing information in Variant Call Format Forked from vcfruby
109
+ at <a
110
+ href="https://github.com/jesserod/vcfruby">github.com/jesserod/vcfruby</a>
111
+ Modified and tests written by Dan MacLean (tsl at dan.maclean.ac.uk) VCF is
112
+ described at <a
113
+ href="http://www.1000genomes.org/node/101">www.1000genomes.org/node/101</a></p>
114
+
115
+ </div>
116
+
117
+
118
+
119
+ <footer id="validator-badges">
120
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
121
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
122
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
123
+ </footer>
124
+
@@ -41,6 +41,9 @@
41
41
  </li>
42
42
  <li class="class">
43
43
  <a href="Bio/DB/Alignment.html">Bio::DB::Alignment</a>
44
+ </li>
45
+ <li class="class">
46
+ <a href="Bio/DB/Pileup.html">Bio::DB::Pileup</a>
44
47
  </li>
45
48
  <li class="module">
46
49
  <a href="Bio/DB/SAM.html">Bio::DB::SAM</a>
@@ -77,25 +80,12 @@
77
80
  </li>
78
81
  <li class="class">
79
82
  <a href="Bio/DB/Tag.html">Bio::DB::Tag</a>
80
- </li>
81
- <li class="module">
82
- <a href="LibC.html">LibC</a>
83
83
  </li>
84
84
  <li class="class">
85
- <a href="Pileup.html">Pileup</a>
86
-
87
- <img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings">
88
- <ul class="initially-hidden">
89
- <li><a href="Pileup.html#label-Pileup+">Pileup </a>
90
- </ul>
85
+ <a href="Bio/DB/Vcf.html">Bio::DB::Vcf</a>
91
86
  </li>
92
- <li class="class">
93
- <a href="Vcf.html">Vcf</a>
94
-
95
- <img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings">
96
- <ul class="initially-hidden">
97
- <li><a href="Vcf.html#label-Vcf+">Vcf </a>
98
- </ul>
87
+ <li class="module">
88
+ <a href="LibC.html">LibC</a>
99
89
  </li>
100
90
 
101
91
  </ul>
@@ -107,22 +97,22 @@
107
97
 
108
98
  <li class="method"><a href="Bio/DB/SAM/Library.html#method-c-filename">::filename &mdash; Bio::DB::SAM::Library</a>
109
99
 
110
- <li class="method"><a href="Bio/DB/Sam.html#method-c-finalize">::finalize &mdash; Bio::DB::Sam</a>
111
-
112
100
  <li class="method"><a href="Bio/DB/Alignment.html#method-c-finalize">::finalize &mdash; Bio::DB::Alignment</a>
113
101
 
102
+ <li class="method"><a href="Bio/DB/Sam.html#method-c-finalize">::finalize &mdash; Bio::DB::Sam</a>
103
+
114
104
  <li class="method"><a href="Bio/DB/Sam.html#method-c-merge">::merge &mdash; Bio::DB::Sam</a>
115
105
 
116
106
  <li class="method"><a href="Bio/DB/Alignment.html#method-c-new">::new &mdash; Bio::DB::Alignment</a>
117
107
 
118
- <li class="method"><a href="Pileup.html#method-c-new">::new &mdash; Pileup</a>
119
-
120
- <li class="method"><a href="Vcf.html#method-c-new">::new &mdash; Vcf</a>
108
+ <li class="method"><a href="Bio/DB/Vcf.html#method-c-new">::new &mdash; Bio::DB::Vcf</a>
121
109
 
122
110
  <li class="method"><a href="Bio/DB/Sam.html#method-c-new">::new &mdash; Bio::DB::Sam</a>
123
111
 
124
112
  <li class="method"><a href="Bio/DB/SAMException.html#method-c-new">::new &mdash; Bio::DB::SAMException</a>
125
113
 
114
+ <li class="method"><a href="Bio/DB/Pileup.html#method-c-new">::new &mdash; Bio::DB::Pileup</a>
115
+
126
116
  <li class="method"><a href="Bio/DB/Sam.html#method-i-average_coverage">#average_coverage &mdash; Bio::DB::Sam</a>
127
117
 
128
118
  <li class="method"><a href="Bio/DB/Sam.html#method-i-chromosome_coverage">#chromosome_coverage &mdash; Bio::DB::Sam</a>
@@ -139,7 +129,7 @@
139
129
 
140
130
  <li class="method"><a href="Bio/DB/Sam.html#method-i-index_stats">#index_stats &mdash; Bio::DB::Sam</a>
141
131
 
142
- <li class="method"><a href="Vcf.html#method-i-int_or_raw">#int_or_raw &mdash; Vcf</a>
132
+ <li class="method"><a href="Bio/DB/Vcf.html#method-i-int_or_raw">#int_or_raw &mdash; Bio::DB::Vcf</a>
143
133
 
144
134
  <li class="method"><a href="Bio/DB/Sam.html#method-i-load_index">#load_index &mdash; Bio::DB::Sam</a>
145
135
 
@@ -149,19 +139,19 @@
149
139
 
150
140
  <li class="method"><a href="Bio/DB/Sam.html#method-i-mpileup_plus">#mpileup_plus &mdash; Bio::DB::Sam</a>
151
141
 
152
- <li class="method"><a href="Pileup.html#method-i-non_ref_count">#non_ref_count &mdash; Pileup</a>
142
+ <li class="method"><a href="Bio/DB/Pileup.html#method-i-non_ref_count">#non_ref_count &mdash; Bio::DB::Pileup</a>
153
143
 
154
- <li class="method"><a href="Pileup.html#method-i-non_refs">#non_refs &mdash; Pileup</a>
144
+ <li class="method"><a href="Bio/DB/Pileup.html#method-i-non_refs">#non_refs &mdash; Bio::DB::Pileup</a>
155
145
 
156
146
  <li class="method"><a href="Bio/DB/Sam.html#method-i-open">#open &mdash; Bio::DB::Sam</a>
157
147
 
158
- <li class="method"><a href="Vcf.html#method-i-parse_line">#parse_line &mdash; Vcf</a>
148
+ <li class="method"><a href="Bio/DB/Vcf.html#method-i-parse_line">#parse_line &mdash; Bio::DB::Vcf</a>
159
149
 
160
150
  <li class="method"><a href="Bio/DB/SAM/Tools/Bam1T.html#method-i-qname">#qname &mdash; Bio::DB::SAM::Tools::Bam1T</a>
161
151
 
162
152
  <li class="method"><a href="Bio/DB/Sam.html#method-i-query_string">#query_string &mdash; Bio::DB::Sam</a>
163
153
 
164
- <li class="method"><a href="Pileup.html#method-i-ref_count">#ref_count &mdash; Pileup</a>
154
+ <li class="method"><a href="Bio/DB/Pileup.html#method-i-ref_count">#ref_count &mdash; Bio::DB::Pileup</a>
165
155
 
166
156
  <li class="method"><a href="Bio/DB/Alignment.html#method-i-sam-3D">#sam= &mdash; Bio::DB::Alignment</a>
167
157
 
data/doc/tutorial.html CHANGED
@@ -140,7 +140,7 @@ end
140
140
  ...
141
141
  end
142
142
  </code></pre>
143
- <p>Not all the options SAMTools allows you to pass to mpileup are supported, those that cause mpileup to return BCF/VCF are ignored. Specifically these are g,u,e,h,I,L,o,p. The table below lists the SAMTools flags supported and the symbols you can use to call them in the mpileup command.
143
+ <p>Not all the options SAMTools allows you to pass to mpileup will return a Pileup object, those that cause mpileup to return BCF/VCF will be ignored. Specifically these are g,u,e,h,I,L,o,p. The table below lists the SAMTools flags supported and the symbols you can use to call them in the mpileup command.
144
144
  <table>
145
145
  <tr><th>SAMTools option</th><th>description</th><th>short symbol</th><th>long symbol</th><th>default</th><th>example</th></tr>
146
146
  <tr><td><code>r</code></td><td>limit retrieval to a region</td><td><code>:r</code></td><td><code>:region</code></td><td>all positions</td><td><code>:r => "Chr1:1000-2000"</code></tr>
@@ -157,6 +157,31 @@ end
157
157
  <tr><td><code>q</code></td><td>skip alignments with mapping quality smaller than value</td><td><code>:q</code></td><td><code>:min_mapping_quality</code></td><td>0</td><td><code>:q => 30 </code></tr>
158
158
  <tr><td><code>Q</code></td><td>skip bases with base quality smaller than value</td><td><code>:Q</code></td><td><code>:imin_base_quality</code></td><td>13</td><td><code>:Q => 30 </code></tr>
159
159
  </table>
160
+ <br />
161
+ <p>There is an 'experimental' function, <code>mpileup_plus</code>, that can return a Bio::DB::Vcf object when g,u,e,h,I,L,o,p options are passed. The list below shows the symbols you can use to invoke this behaviour:</p>
162
+ <ul>
163
+ <li><code>:genotype_calling, :g</code></li>
164
+ <li><code>:uncompressed_bcf , :u</code></li>
165
+ <li><code>:extension_sequencing_probability, :e</code></li>
166
+ <li><code>:homopolymer_error_coefficient, :h</code></li>
167
+ <li><code>:no_indels, :I</code></li>
168
+ <li><code>:skip_indel_over_average_depth, :L</code></li>
169
+ <li><code>:gap_open_sequencing_error_probability,:o</code></li>
170
+ <li><code>:platforms, :P</code></li>
171
+ </ul>
172
+ <br />
173
+ <h2>Tests</h2>
174
+ <p>The easiest way to run the built-in unit tests is to change to the bio-samtools installation directory (discoverable by typing 'gem which bio-samtools' at the command line) and running the separate test files individually.</p>
175
+ <pre><code class="ruby">gem which 'bio-samtools'
176
+ /some/path/ruby-1.x.x/bio-samtools-0.x.x/lib/bio-samtools.rb
177
+ cd /some/path/ruby-1.x.x/bio-samtools-0.x.x
178
+ ruby test/test_basic.rb
179
+ </code></pre>
180
+ <p> Each test file tests different aspects of the gem.
181
+ <ul>
182
+ <li>test_basic.rb - tests the general functionality of the gem, such as opening and closing BAM, creating indices, fetching regions, checks the correct Pileup format is returned when requested etc.</li>
183
+ <li>test_pileup.rb - tests the Pileup class, making sure attributes are set correctly when Pileup data are passed</li>
184
+ <li>test_vcf.rb - tests the Vcf class, making sure attributes are set correctly when Vcf data are passed</li>
160
185
  </div>
161
186
  </div>
162
187
  </div>
data/doc/tutorial.pdf CHANGED
Binary file
@@ -1,5 +1,5 @@
1
1
  # :title:Pileup
2
- # = Pileup
2
+ # = Bio::DB::Pileup
3
3
  # A class representing information in SAMTools pileup format
4
4
  # Author:: Dan MacLean (dan.maclean@tsl.ac.uk)
5
5
  # Pileup is described at http://sourceforge.net/apps/mediawiki/samtools/index.php?title=SAM_FAQ#I_do_not_understand_the_columns_in_the_pileup_output.
@@ -24,13 +24,14 @@
24
24
  # Pileup provides accessors for all columns (6 or 10 column format) and a few other useful methods
25
25
  #
26
26
  #
27
-
27
+ module Bio
28
+ class DB
28
29
  class Pileup
29
30
  attr_accessor :ref_name, :pos, :ref_base, :coverage, :read_bases, :read_quals, :consensus, :consensus_quality, :snp_quality, :rms_mapq, :ar1, :ar2, :ar3
30
31
 
31
32
  #creates the Pileup object
32
33
  # pile_up_line = "seq2\t151\tG\tG\t36\t0\t99\t12\t...........A\t:9<;;7=<<<<<"
33
- # pile = Pileup.new(pile_up_line)
34
+ # pile = Bio::DB::Pileup.new(pile_up_line)
34
35
  def initialize(pile_up_line)
35
36
  cols = pile_up_line.split(/\t/)
36
37
  if cols.length == 6 ##should only be able to get 6 lines from mpileup
@@ -95,4 +96,5 @@ class Pileup
95
96
  end
96
97
 
97
98
  end
98
-
99
+ end
100
+ end
data/lib/bio/db/sam.rb CHANGED
@@ -2,8 +2,8 @@ require 'bio/db/sam/library'
2
2
  require 'bio/db/sam/bam'
3
3
  require 'bio/db/sam/faidx'
4
4
  require 'bio/db/sam/sam'
5
- require 'bio/db/sam/pileup'
6
- require 'bio/db/sam/vcf'
5
+ #require 'bio/db/pileup'
6
+ #require 'bio/db/vcf'
7
7
 
8
8
  module LibC
9
9
  extend FFI::Library
@@ -298,15 +298,15 @@ module Bio
298
298
  :min_mapping_quality => :q,
299
299
  :min_base_quality => :Q
300
300
  }
301
-
302
301
  ##convert any long_opts to short opts
302
+ temp_opts = opts.dup
303
303
  opts.each_pair do |k,v|
304
304
  if long_opts[k]
305
- opts[long_opts[k]] = v
306
- opts.delete(k)
305
+ temp_opts[long_opts[k]] = v
306
+ temp_opts.delete(k)
307
307
  end
308
308
  end
309
-
309
+ opts = temp_opts
310
310
  ##remove any calls to -g or -u for mpileup, bcf output is not yet supported
311
311
  ##and also associated output options
312
312
  [:g, :u, :e, :h, :I, :L, :o, :p].each {|x| opts.delete(x) }
@@ -325,7 +325,7 @@ module Bio
325
325
 
326
326
  sam_pipe = IO.popen(sam_command)
327
327
  while line = sam_pipe.gets
328
- yield Pileup.new(line)
328
+ yield Bio::DB::Pileup.new(line)
329
329
  end
330
330
  sam_pipe.close
331
331
  #strptrs << FFI::MemoryPointer.from_string('-f')
@@ -391,13 +391,14 @@ module Bio
391
391
  }
392
392
 
393
393
  ##convert any long_opts to short opts
394
+ temp_opts = opts.dup
394
395
  opts.each_pair do |k,v|
395
396
  if long_opts[k]
396
- opts[long_opts[k]] = v
397
- opts.delete(k)
397
+ temp_opts[long_opts[k]] = v
398
+ temp_opts.delete(k)
398
399
  end
399
400
  end
400
-
401
+ opts = temp_opts
401
402
  ##remove any calls to -g or -u for mpileup, bcf output is not yet supported
402
403
  ##and also associated output options
403
404
  #[:g, :u, :e, :h, :I, :L, :o, :p].each {|x| opts.delete(x) }
@@ -424,11 +425,11 @@ module Bio
424
425
  if opts[:u]
425
426
  while line = pipe.gets
426
427
  next if line[0,1] == '#' #skip any header or meta-lines, we dont do anything with those
427
- yield Vcf.new(line)
428
+ yield Bio::DB::Vcf.new(line)
428
429
  end
429
430
  else
430
431
  while line = pipe.gets
431
- yield Pileup.new(line)
432
+ yield Bio::DB::Pileup.new(line)
432
433
  end
433
434
  end
434
435
  pipe.close