bio-gngm 0.1.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.
- data/.document +5 -0
- data/Gemfile +20 -0
- data/Gemfile.lock +33 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +33 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/bio-gngm.gemspec +173 -0
- data/doc/Bio.html +129 -0
- data/doc/Bio/DB.html +128 -0
- data/doc/Bio/DB/Pileup.html +316 -0
- data/doc/Bio/DB/Vcf.html +683 -0
- data/doc/Bio/Util.html +135 -0
- data/doc/Bio/Util/Gngm.html +1655 -0
- data/doc/LICENSE_txt.html +111 -0
- data/doc/_index.html +169 -0
- data/doc/class_list.html +47 -0
- data/doc/created.rid +4 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/doc/created.rid +0 -0
- data/doc/file_list.html +52 -0
- data/doc/frames.html +13 -0
- data/doc/images/add.png +0 -0
- data/doc/images/bands.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/signal.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/threads.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 +88 -0
- data/doc/js/app.js +205 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/full_list.js +167 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/lib/bio-gngm_rb.html +103 -0
- data/doc/lib/bio/util/bio-gngm_rb.html +96 -0
- data/doc/method_list.html +382 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +161 -0
- data/examples/.DS_Store +0 -0
- data/examples/make_histograms.rb +40 -0
- data/examples/make_threads.rb +42 -0
- data/examples/make_threads_isize.rb +41 -0
- data/examples/use_indels.rb +36 -0
- data/lib/bio-gngm.rb +12 -0
- data/lib/bio/util/bio-gngm.rb +1029 -0
- data/scripts/get_subseq.rb +16 -0
- data/scripts/make_histograms_laerfyve.rb +83 -0
- data/scripts/make_histograms_laerfyve_stitched.rb +59 -0
- data/scripts/make_threads_isize_laerfyfe.rb +52 -0
- data/scripts/make_threads_unmapped_laerfyfe.rb +72 -0
- data/scripts/make_threads_unmapped_laerfyfe_pseudo.rb +56 -0
- data/scripts/make_threads_unmapped_simulation.rb +54 -0
- data/scripts/make_threads_unmapped_simulation_immediate_region.rb +59 -0
- data/scripts/optimise_freq_window_size.rb +82 -0
- data/stitched_contigs.zip +0 -0
- data/test/data/ids2.txt +1 -0
- data/test/data/sorted.bam +0 -0
- data/test/data/test +0 -0
- data/test/data/test.bam +0 -0
- data/test/data/test.fa +20 -0
- data/test/data/test.fai +0 -0
- data/test/data/test.sai +0 -0
- data/test/data/test.tam +10 -0
- data/test/data/test_chr.fasta +1000 -0
- data/test/data/test_chr.fasta.amb +2 -0
- data/test/data/test_chr.fasta.ann +3 -0
- data/test/data/test_chr.fasta.bwt +0 -0
- data/test/data/test_chr.fasta.fai +1 -0
- data/test/data/test_chr.fasta.pac +0 -0
- data/test/data/test_chr.fasta.rbwt +0 -0
- data/test/data/test_chr.fasta.rpac +0 -0
- data/test/data/test_chr.fasta.rsa +0 -0
- data/test/data/test_chr.fasta.sa +0 -0
- data/test/data/testu.bam +0 -0
- data/test/data/testu.bam.bai +0 -0
- data/test/helper.rb +18 -0
- data/test/test_bio-gngm.rb +126 -0
- metadata +276 -0
data/doc/Bio/DB.html
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>Module: Bio::DB</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 id="top" class="module">
|
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="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
</ul>
|
51
|
+
</nav>
|
52
|
+
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
<div id="class-metadata">
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div id="project-metadata">
|
64
|
+
<nav id="fileindex-section" class="section project-section">
|
65
|
+
<h3 class="section-header">Pages</h3>
|
66
|
+
|
67
|
+
<ul>
|
68
|
+
|
69
|
+
<li class="file"><a href="../LICENSE_txt.html">LICENSE</a>
|
70
|
+
|
71
|
+
</ul>
|
72
|
+
</nav>
|
73
|
+
|
74
|
+
<nav id="classindex-section" class="section project-section">
|
75
|
+
<h3 class="section-header">Class and Module Index</h3>
|
76
|
+
|
77
|
+
<ul class="link-list">
|
78
|
+
|
79
|
+
<li><a href="../Bio.html">Bio</a>
|
80
|
+
|
81
|
+
<li><a href="../Bio/DB.html">Bio::DB</a>
|
82
|
+
|
83
|
+
<li><a href="../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
|
84
|
+
|
85
|
+
<li><a href="../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
|
86
|
+
|
87
|
+
<li><a href="../Bio/Util.html">Bio::Util</a>
|
88
|
+
|
89
|
+
<li><a href="../Bio/Util/Gngm.html">Bio::Util::Gngm</a>
|
90
|
+
|
91
|
+
</ul>
|
92
|
+
</nav>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
</nav>
|
96
|
+
|
97
|
+
<div id="documentation">
|
98
|
+
<h1 class="module">module Bio::DB</h1>
|
99
|
+
|
100
|
+
<div id="description" class="description">
|
101
|
+
|
102
|
+
</div><!-- description -->
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<!-- Methods -->
|
117
|
+
|
118
|
+
</section><!-- 5Buntitled-5D -->
|
119
|
+
|
120
|
+
</div><!-- documentation -->
|
121
|
+
|
122
|
+
|
123
|
+
<footer id="validator-badges">
|
124
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
125
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
|
126
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
127
|
+
</footer>
|
128
|
+
|
@@ -0,0 +1,316 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>Class: Bio::DB::Pileup</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 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>
|
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="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/bio/util/bio-gngm.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">Object
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-i-discordant_chastity">#discordant_chastity</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-is_snp-3F">#is_snp?</a>
|
76
|
+
|
77
|
+
</ul>
|
78
|
+
</nav>
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div id="project-metadata">
|
83
|
+
<nav id="fileindex-section" class="section project-section">
|
84
|
+
<h3 class="section-header">Pages</h3>
|
85
|
+
|
86
|
+
<ul>
|
87
|
+
|
88
|
+
<li class="file"><a href="../../LICENSE_txt.html">LICENSE</a>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</nav>
|
92
|
+
|
93
|
+
<nav id="classindex-section" class="section project-section">
|
94
|
+
<h3 class="section-header">Class and Module Index</h3>
|
95
|
+
|
96
|
+
<ul class="link-list">
|
97
|
+
|
98
|
+
<li><a href="../../Bio.html">Bio</a>
|
99
|
+
|
100
|
+
<li><a href="../../Bio/DB.html">Bio::DB</a>
|
101
|
+
|
102
|
+
<li><a href="../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
|
103
|
+
|
104
|
+
<li><a href="../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
|
105
|
+
|
106
|
+
<li><a href="../../Bio/Util.html">Bio::Util</a>
|
107
|
+
|
108
|
+
<li><a href="../../Bio/Util/Gngm.html">Bio::Util::Gngm</a>
|
109
|
+
|
110
|
+
</ul>
|
111
|
+
</nav>
|
112
|
+
|
113
|
+
</div>
|
114
|
+
</nav>
|
115
|
+
|
116
|
+
<div id="documentation">
|
117
|
+
<h1 class="class">class Bio::DB::Pileup</h1>
|
118
|
+
|
119
|
+
<div id="description" class="description">
|
120
|
+
|
121
|
+
<p>Extends the methods of the <a href="Pileup.html">Bio::DB::Pileup</a> class
|
122
|
+
in bio-samtools. A pileup object represents the SAMtools pileup format at
|
123
|
+
<a
|
124
|
+
href="http://samtools.sourceforge.net/pileup.shtml.">samtools.sourceforge.net/pileup.shtml.</a>
|
125
|
+
These extension methods are used by the <a
|
126
|
+
href="../Util/Gngm.html">Bio::Util::Gngm</a> object internally and are not
|
127
|
+
exposed to the user of the <a href="../Util/Gngm.html">Bio::Util::Gngm</a>
|
128
|
+
object through that.</p>
|
129
|
+
|
130
|
+
</div><!-- description -->
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
<!-- Attributes -->
|
144
|
+
<section id="attribute-method-details" class="method-section section">
|
145
|
+
<h3 class="section-header">Attributes</h3>
|
146
|
+
|
147
|
+
|
148
|
+
<div id="attribute-i-second_non_ref_count" class="method-detail">
|
149
|
+
<div class="method-heading attribute-method-heading">
|
150
|
+
<span class="method-name">second_non_ref_count</span><span
|
151
|
+
class="attribute-access-type">[RW]</span>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<div class="method-description">
|
155
|
+
|
156
|
+
<p>attributes set by call to <a
|
157
|
+
href="Pileup.html#method-i-discordant_chastity">#discordant_chastity</a></p>
|
158
|
+
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div id="attribute-i-third_non_ref_count" class="method-detail">
|
163
|
+
<div class="method-heading attribute-method-heading">
|
164
|
+
<span class="method-name">third_non_ref_count</span><span
|
165
|
+
class="attribute-access-type">[RW]</span>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div class="method-description">
|
169
|
+
|
170
|
+
<p>attributes set by call to <a
|
171
|
+
href="Pileup.html#method-i-discordant_chastity">#discordant_chastity</a></p>
|
172
|
+
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div id="attribute-i-top_non_ref_count" class="method-detail">
|
177
|
+
<div class="method-heading attribute-method-heading">
|
178
|
+
<span class="method-name">top_non_ref_count</span><span
|
179
|
+
class="attribute-access-type">[RW]</span>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div class="method-description">
|
183
|
+
|
184
|
+
<p>attributes set by call to <a
|
185
|
+
href="Pileup.html#method-i-discordant_chastity">#discordant_chastity</a></p>
|
186
|
+
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
</section><!-- attribute-method-details -->
|
191
|
+
|
192
|
+
|
193
|
+
<!-- Methods -->
|
194
|
+
|
195
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
196
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
197
|
+
|
198
|
+
|
199
|
+
<div id="method-i-discordant_chastity" class="method-detail ">
|
200
|
+
|
201
|
+
<div class="method-heading">
|
202
|
+
<span class="method-name">discordant_chastity</span><span
|
203
|
+
class="method-args">()</span>
|
204
|
+
<span class="method-click-advice">click to toggle source</span>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
<div class="method-description">
|
209
|
+
|
210
|
+
<p>calculates the discordant chastity statistic as defined in Austin et al
|
211
|
+
(2011) <a
|
212
|
+
href="http://bar.utoronto.ca/ngm/description.html">bar.utoronto.ca/ngm/description.html</a>
|
213
|
+
and <a
|
214
|
+
href="http://onlinelibrary.wiley.com/doi/10.1111/j.1365-313X.2011.04619.x/abstract;jsessionid=F73E2DA628523B26205297CEE95526DA.d02t04">onlinelibrary.wiley.com/doi/10.1111/j.1365-313X.2011.04619.x/abstract;jsessionid=F73E2DA628523B26205297CEE95526DA.d02t04</a>
|
215
|
+
Austin <em>et</em> <em>al</em> (2011) <strong>Next-generation</strong>
|
216
|
+
<strong>mapping</strong> <strong>of</strong> <strong>Arabidopsis</strong>
|
217
|
+
<strong>genes</strong> <em>Plant</em> <em>Journal</em>
|
218
|
+
<strong>67</strong>(4):7125-725</p>
|
219
|
+
|
220
|
+
<p>Briefly,</p>
|
221
|
+
|
222
|
+
<pre>The statistic measures the degree of difference between the SNP and the expected reference base.
|
223
|
+
Using the mapping information comprising a SNP, the most frequent base that is not the reference base
|
224
|
+
is compared to the next most common base after it.
|
225
|
+
(from http://bar.utoronto.ca/ngm/description.html )</pre>
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
<div class="method-source-code" id="discordant_chastity-source">
|
230
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 33</span>
|
231
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">discordant_chastity</span>
|
232
|
+
<span class="ruby-identifier">arr</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">non_refs</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">sort</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span>,<span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">last</span> }
|
233
|
+
<span class="ruby-ivar">@top_non_ref_count</span>, <span class="ruby-ivar">@second_non_ref_count</span>, <span class="ruby-ivar">@third_non_ref_count</span> = <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">collect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">last</span>}
|
234
|
+
<span class="ruby-keyword">case</span>
|
235
|
+
<span class="ruby-keyword">when</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">non_ref_count</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword">then</span> <span class="ruby-value">0.0</span>
|
236
|
+
<span class="ruby-keyword">when</span> <span class="ruby-ivar">@top_non_ref_count</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@coverage</span> <span class="ruby-keyword">then</span> <span class="ruby-value">1.0</span>
|
237
|
+
<span class="ruby-keyword">when</span> <span class="ruby-ivar">@second_non_ref_count</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> <span class="ruby-keyword">then</span> <span class="ruby-ivar">@top_non_ref_count</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> (<span class="ruby-ivar">@top_non_ref_count</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@second_non_ref_count</span>).<span class="ruby-identifier">to_f</span>
|
238
|
+
<span class="ruby-keyword">else</span> <span class="ruby-ivar">@top_non_ref_count</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-ivar">@coverage</span>.<span class="ruby-identifier">to_f</span>
|
239
|
+
<span class="ruby-keyword">end</span>
|
240
|
+
<span class="ruby-keyword">end</span></pre>
|
241
|
+
</div><!-- discordant_chastity-source -->
|
242
|
+
|
243
|
+
</div>
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
</div><!-- discordant_chastity-method -->
|
249
|
+
|
250
|
+
|
251
|
+
<div id="method-i-is_snp-3F" class="method-detail ">
|
252
|
+
|
253
|
+
<div class="method-heading">
|
254
|
+
<span class="method-name">is_snp?</span><span
|
255
|
+
class="method-args">(opts)</span>
|
256
|
+
<span class="method-click-advice">click to toggle source</span>
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
<div class="method-description">
|
261
|
+
|
262
|
+
<p>returns true if self is a SNP with minimum coverage depth of
|
263
|
+
<code>:min_depth</code> and minimum non-reference bases of
|
264
|
+
<code>:min_non_ref_count</code> returns false for every position where the
|
265
|
+
reference base is N or n if <code>:ignore_reference_n</code> is set to true</p>
|
266
|
+
|
267
|
+
<p>Options and Defaults:</p>
|
268
|
+
<ul><li>
|
269
|
+
<p>:min_depth => 2</p>
|
270
|
+
</li><li>
|
271
|
+
<p>:min_non_ref_count => 2</p>
|
272
|
+
</li><li>
|
273
|
+
<p>:ignore_reference_n => false</p>
|
274
|
+
</li></ul>
|
275
|
+
|
276
|
+
<p>Example</p>
|
277
|
+
|
278
|
+
<pre class="ruby"><span class="ruby-identifier">pileup</span>.<span class="ruby-identifier">is_snp?</span>(:<span class="ruby-identifier">min_depth</span> =<span class="ruby-operator">></span> <span class="ruby-value">5</span>, :<span class="ruby-identifier">min_non_ref_count</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>)
|
279
|
+
<span class="ruby-identifier">pileup</span>.<span class="ruby-identifier">is_snp?</span>(:<span class="ruby-identifier">min_depth</span> =<span class="ruby-operator">></span> <span class="ruby-value">5</span>, :<span class="ruby-identifier">min_non_ref_count</span> =<span class="ruby-operator">></span> <span class="ruby-value">1</span>, :<span class="ruby-identifier">ignore_reference_n</span> =<span class="ruby-operator">></span> <span class="ruby-keyword">true</span>)
|
280
|
+
</pre>
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
<div class="method-source-code" id="is_snp-3F-source">
|
285
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 55</span>
|
286
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_snp?</span>(<span class="ruby-identifier">opts</span>)
|
287
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:ignore_reference_n</span>] <span class="ruby-keyword">and</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref_base</span> <span class="ruby-operator">==</span> <span class="ruby-string">"N"</span> <span class="ruby-keyword">or</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref_base</span> <span class="ruby-operator">==</span> <span class="ruby-string">"n"</span>
|
288
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span>
|
289
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">coverage</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:min_depth</span>] <span class="ruby-keyword">and</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">non_ref_count</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:min_non_ref_count</span>]
|
290
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>
|
291
|
+
<span class="ruby-keyword">end</span>
|
292
|
+
<span class="ruby-keyword">false</span>
|
293
|
+
<span class="ruby-keyword">end</span></pre>
|
294
|
+
</div><!-- is_snp-3F-source -->
|
295
|
+
|
296
|
+
</div>
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
</div><!-- is_snp-3F-method -->
|
302
|
+
|
303
|
+
|
304
|
+
</section><!-- public-instance-method-details -->
|
305
|
+
|
306
|
+
</section><!-- 5Buntitled-5D -->
|
307
|
+
|
308
|
+
</div><!-- documentation -->
|
309
|
+
|
310
|
+
|
311
|
+
<footer id="validator-badges">
|
312
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
313
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
|
314
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
315
|
+
</footer>
|
316
|
+
|
data/doc/Bio/DB/Vcf.html
ADDED
@@ -0,0 +1,683 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>Class: Bio::DB::Vcf</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 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>
|
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="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/bio/util/bio-gngm.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">Object
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-i-alternatives">#alternatives</a>
|
74
|
+
|
75
|
+
<li><a href="#method-i-gq">#gq</a>
|
76
|
+
|
77
|
+
<li><a href="#method-i-has_just_one_variant-3F">#has_just_one_variant?</a>
|
78
|
+
|
79
|
+
<li><a href="#method-i-is_deletion-3F">#is_deletion?</a>
|
80
|
+
|
81
|
+
<li><a href="#method-i-is_indel-3F">#is_indel?</a>
|
82
|
+
|
83
|
+
<li><a href="#method-i-is_insertion-3F">#is_insertion?</a>
|
84
|
+
|
85
|
+
<li><a href="#method-i-mq">#mq</a>
|
86
|
+
|
87
|
+
<li><a href="#method-i-non_ref_allele_count">#non_ref_allele_count</a>
|
88
|
+
|
89
|
+
<li><a href="#method-i-non_ref_allele_freq">#non_ref_allele_freq</a>
|
90
|
+
|
91
|
+
<li><a href="#method-i-pass_quality-3F">#pass_quality?</a>
|
92
|
+
|
93
|
+
<li><a href="#method-i-pl">#pl</a>
|
94
|
+
|
95
|
+
<li><a href="#method-i-to_s">#to_s</a>
|
96
|
+
|
97
|
+
<li><a href="#method-i-used_depth">#used_depth</a>
|
98
|
+
|
99
|
+
<li><a href="#method-i-variant-3F">#variant?</a>
|
100
|
+
|
101
|
+
</ul>
|
102
|
+
</nav>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<div id="project-metadata">
|
107
|
+
<nav id="fileindex-section" class="section project-section">
|
108
|
+
<h3 class="section-header">Pages</h3>
|
109
|
+
|
110
|
+
<ul>
|
111
|
+
|
112
|
+
<li class="file"><a href="../../LICENSE_txt.html">LICENSE</a>
|
113
|
+
|
114
|
+
</ul>
|
115
|
+
</nav>
|
116
|
+
|
117
|
+
<nav id="classindex-section" class="section project-section">
|
118
|
+
<h3 class="section-header">Class and Module Index</h3>
|
119
|
+
|
120
|
+
<ul class="link-list">
|
121
|
+
|
122
|
+
<li><a href="../../Bio.html">Bio</a>
|
123
|
+
|
124
|
+
<li><a href="../../Bio/DB.html">Bio::DB</a>
|
125
|
+
|
126
|
+
<li><a href="../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
|
127
|
+
|
128
|
+
<li><a href="../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
|
129
|
+
|
130
|
+
<li><a href="../../Bio/Util.html">Bio::Util</a>
|
131
|
+
|
132
|
+
<li><a href="../../Bio/Util/Gngm.html">Bio::Util::Gngm</a>
|
133
|
+
|
134
|
+
</ul>
|
135
|
+
</nav>
|
136
|
+
|
137
|
+
</div>
|
138
|
+
</nav>
|
139
|
+
|
140
|
+
<div id="documentation">
|
141
|
+
<h1 class="class">class Bio::DB::Vcf</h1>
|
142
|
+
|
143
|
+
<div id="description" class="description">
|
144
|
+
|
145
|
+
<p>Extends the methods of the <a href="Vcf.html">Bio::DB::Vcf</a> class in
|
146
|
+
bio-samtools. A <a href="Vcf.html">Vcf</a> object represents the VCF format
|
147
|
+
described at <a
|
148
|
+
href="http://www.1000genomes.org/node/101">www.1000genomes.org/node/101</a>
|
149
|
+
. The <a href="Vcf.html">Bio::DB::Vcf</a> object returns all information in
|
150
|
+
the VCF line, but the implementation here acts as if there is only possibly
|
151
|
+
one variant at each position and ignores positions at which there may be
|
152
|
+
multiple variants. <a href="Vcf.html">Vcf</a> format is only used when the
|
153
|
+
<a href="../Util/Gngm.html">Bio::Util::Gngm</a> object requests information
|
154
|
+
about indels using SAMtools mpileup method.</p>
|
155
|
+
|
156
|
+
</div><!-- description -->
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
<!-- Methods -->
|
171
|
+
|
172
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
173
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
174
|
+
|
175
|
+
|
176
|
+
<div id="method-i-alternatives" class="method-detail ">
|
177
|
+
|
178
|
+
<div class="method-heading">
|
179
|
+
<span class="method-name">alternatives</span><span
|
180
|
+
class="method-args">()</span>
|
181
|
+
<span class="method-click-advice">click to toggle source</span>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
<div class="method-description">
|
186
|
+
|
187
|
+
<p>List of alternate alleles at this locus, obtained by splitting the vcf.alt
|
188
|
+
attribute string on commas</p>
|
189
|
+
|
190
|
+
<p>Example vcf.alt = “ACT,TCA”</p>
|
191
|
+
|
192
|
+
<pre>vcf.alternatives = ["ACT", "TCA"]</pre>
|
193
|
+
|
194
|
+
<p>vcf.alt = “T”</p>
|
195
|
+
|
196
|
+
<pre>vcf.alternatives = ["T"]</pre>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
<div class="method-source-code" id="alternatives-source">
|
201
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 101</span>
|
202
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">alternatives</span>
|
203
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">alt</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">","</span>) <span class="ruby-keyword">rescue</span> []
|
204
|
+
<span class="ruby-keyword">end</span></pre>
|
205
|
+
</div><!-- alternatives-source -->
|
206
|
+
|
207
|
+
</div>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</div><!-- alternatives-method -->
|
213
|
+
|
214
|
+
|
215
|
+
<div id="method-i-gq" class="method-detail ">
|
216
|
+
|
217
|
+
<div class="method-heading">
|
218
|
+
<span class="method-name">gq</span><span
|
219
|
+
class="method-args">()</span>
|
220
|
+
<span class="method-click-advice">click to toggle source</span>
|
221
|
+
</div>
|
222
|
+
|
223
|
+
|
224
|
+
<div class="method-description">
|
225
|
+
|
226
|
+
<p>Returns the genotype quality score from the sample data (as defined by the
|
227
|
+
<a href="Vcf.html">Vcf</a> GQ attribute) for the first sample in the <a
|
228
|
+
href="Vcf.html">Vcf</a> only.</p>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
<div class="method-source-code" id="gq-source">
|
233
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 124</span>
|
234
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">gq</span>
|
235
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">samples</span>[<span class="ruby-string">"1"</span>][<span class="ruby-string">"GQ"</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-keyword">rescue</span> <span class="ruby-value">0.0</span>
|
236
|
+
<span class="ruby-keyword">end</span></pre>
|
237
|
+
</div><!-- gq-source -->
|
238
|
+
|
239
|
+
</div>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
</div><!-- gq-method -->
|
245
|
+
|
246
|
+
|
247
|
+
<div id="method-i-has_just_one_variant-3F" class="method-detail ">
|
248
|
+
|
249
|
+
<div class="method-heading">
|
250
|
+
<span class="method-name">has_just_one_variant?</span><span
|
251
|
+
class="method-args">()</span>
|
252
|
+
<span class="method-click-advice">click to toggle source</span>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
|
256
|
+
<div class="method-description">
|
257
|
+
|
258
|
+
<p>Returns true if only one variant allele is recorded. Loci with more than
|
259
|
+
one allele are too complicated for now, so are discarded…</p>
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<div class="method-source-code" id="has_just_one_variant-3F-source">
|
264
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 134</span>
|
265
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">has_just_one_variant?</span>
|
266
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">alternatives</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">variant?</span>
|
267
|
+
<span class="ruby-keyword">end</span></pre>
|
268
|
+
</div><!-- has_just_one_variant-3F-source -->
|
269
|
+
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
</div><!-- has_just_one_variant-3F-method -->
|
276
|
+
|
277
|
+
|
278
|
+
<div id="method-i-is_deletion-3F" class="method-detail ">
|
279
|
+
|
280
|
+
<div class="method-heading">
|
281
|
+
<span class="method-name">is_deletion?</span><span
|
282
|
+
class="method-args">(options)</span>
|
283
|
+
<span class="method-click-advice">click to toggle source</span>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
|
287
|
+
<div class="method-description">
|
288
|
+
|
289
|
+
<p>Returns true if the length of the alt column is less than that of the ref
|
290
|
+
column in the <a href="Vcf.html">Vcf</a> and if <a
|
291
|
+
href="Vcf.html#method-i-pass_quality-3F">#pass_quality?</a> is true. Looks
|
292
|
+
only at the positions that are predicted simple deletions, any positions
|
293
|
+
where the alt alleles includes more than one deletion or a SNP or an
|
294
|
+
insertion also is ignored.</p>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
<div class="method-source-code" id="is_deletion-3F-source">
|
299
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 153</span>
|
300
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_deletion?</span>(<span class="ruby-identifier">options</span>)
|
301
|
+
<span class="ruby-keyword">case</span>
|
302
|
+
<span class="ruby-keyword">when</span> (<span class="ruby-keyword">not</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">has_just_one_variant?</span>) <span class="ruby-keyword">then</span> <span class="ruby-keyword">false</span>
|
303
|
+
<span class="ruby-keyword">when</span> ( <span class="ruby-keyword">self</span>.<span class="ruby-identifier">alt</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator"><</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">length</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pass_quality?</span>(<span class="ruby-identifier">options</span>) ) <span class="ruby-keyword">then</span> <span class="ruby-keyword">true</span>
|
304
|
+
<span class="ruby-keyword">else</span> <span class="ruby-keyword">false</span>
|
305
|
+
<span class="ruby-keyword">end</span>
|
306
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-comment">## if something goes wrong, skip the postion, </span>
|
307
|
+
<span class="ruby-keyword">false</span>
|
308
|
+
<span class="ruby-keyword">end</span></pre>
|
309
|
+
</div><!-- is_deletion-3F-source -->
|
310
|
+
|
311
|
+
</div>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
</div><!-- is_deletion-3F-method -->
|
317
|
+
|
318
|
+
|
319
|
+
<div id="method-i-is_indel-3F" class="method-detail ">
|
320
|
+
|
321
|
+
<div class="method-heading">
|
322
|
+
<span class="method-name">is_indel?</span><span
|
323
|
+
class="method-args">(opts)</span>
|
324
|
+
<span class="method-click-advice">click to toggle source</span>
|
325
|
+
</div>
|
326
|
+
|
327
|
+
|
328
|
+
<div class="method-description">
|
329
|
+
|
330
|
+
<p>Returns true if either <a
|
331
|
+
href="Vcf.html#method-i-is_insertion-3F">#is_insertion?</a> or <a
|
332
|
+
href="Vcf.html#method-i-is_deletion-3F">#is_deletion?</a> is true</p>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
<div class="method-source-code" id="is_indel-3F-source">
|
337
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 176</span>
|
338
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_indel?</span>(<span class="ruby-identifier">opts</span>)
|
339
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">is_insertion?</span>(<span class="ruby-identifier">opts</span>) <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">is_deletion?</span>(<span class="ruby-identifier">opts</span>)
|
340
|
+
<span class="ruby-keyword">end</span></pre>
|
341
|
+
</div><!-- is_indel-3F-source -->
|
342
|
+
|
343
|
+
</div>
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
</div><!-- is_indel-3F-method -->
|
349
|
+
|
350
|
+
|
351
|
+
<div id="method-i-is_insertion-3F" class="method-detail ">
|
352
|
+
|
353
|
+
<div class="method-heading">
|
354
|
+
<span class="method-name">is_insertion?</span><span
|
355
|
+
class="method-args">(options)</span>
|
356
|
+
<span class="method-click-advice">click to toggle source</span>
|
357
|
+
</div>
|
358
|
+
|
359
|
+
|
360
|
+
<div class="method-description">
|
361
|
+
|
362
|
+
<p>Returns true if the length of the alt column is greater than that of the
|
363
|
+
ref column in the <a href="Vcf.html">Vcf</a> and if <a
|
364
|
+
href="Vcf.html#method-i-pass_quality-3F">#pass_quality?</a> is true. Looks
|
365
|
+
only at the positions that are predicted simple deletions, any positions
|
366
|
+
where the alt alleles includes more than one deletion or a SNP or an
|
367
|
+
insertion also is ignored.</p>
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
<div class="method-source-code" id="is_insertion-3F-source">
|
372
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 165</span>
|
373
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">is_insertion?</span>(<span class="ruby-identifier">options</span>)
|
374
|
+
<span class="ruby-keyword">case</span>
|
375
|
+
<span class="ruby-keyword">when</span> (<span class="ruby-keyword">not</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">has_just_one_variant?</span>) <span class="ruby-keyword">then</span> <span class="ruby-keyword">false</span>
|
376
|
+
<span class="ruby-keyword">when</span> ( <span class="ruby-keyword">self</span>.<span class="ruby-identifier">alt</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">ref</span>.<span class="ruby-identifier">length</span> <span class="ruby-keyword">and</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">pass_quality?</span>(<span class="ruby-identifier">options</span>) ) <span class="ruby-keyword">then</span> <span class="ruby-keyword">true</span>
|
377
|
+
<span class="ruby-keyword">else</span> <span class="ruby-keyword">false</span>
|
378
|
+
<span class="ruby-keyword">end</span>
|
379
|
+
<span class="ruby-keyword">rescue</span> <span class="ruby-comment">## if something goes wrong, skip the postion, </span>
|
380
|
+
<span class="ruby-keyword">false</span>
|
381
|
+
<span class="ruby-keyword">end</span></pre>
|
382
|
+
</div><!-- is_insertion-3F-source -->
|
383
|
+
|
384
|
+
</div>
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
</div><!-- is_insertion-3F-method -->
|
390
|
+
|
391
|
+
|
392
|
+
<div id="method-i-mq" class="method-detail ">
|
393
|
+
|
394
|
+
<div class="method-heading">
|
395
|
+
<span class="method-name">mq</span><span
|
396
|
+
class="method-args">()</span>
|
397
|
+
<span class="method-click-advice">click to toggle source</span>
|
398
|
+
</div>
|
399
|
+
|
400
|
+
|
401
|
+
<div class="method-description">
|
402
|
+
|
403
|
+
<p>Returns the mean Mapping Quality from the reads over this position as
|
404
|
+
defined by the <a href="Vcf.html">Vcf</a> MQ attribute.</p>
|
405
|
+
|
406
|
+
|
407
|
+
|
408
|
+
<div class="method-source-code" id="mq-source">
|
409
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 119</span>
|
410
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">mq</span>
|
411
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">info</span>[<span class="ruby-string">"MQ"</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-keyword">rescue</span> <span class="ruby-value">0.0</span>
|
412
|
+
<span class="ruby-keyword">end</span></pre>
|
413
|
+
</div><!-- mq-source -->
|
414
|
+
|
415
|
+
</div>
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
|
420
|
+
</div><!-- mq-method -->
|
421
|
+
|
422
|
+
|
423
|
+
<div id="method-i-non_ref_allele_count" class="method-detail ">
|
424
|
+
|
425
|
+
<div class="method-heading">
|
426
|
+
<span class="method-name">non_ref_allele_count</span><span
|
427
|
+
class="method-args">()</span>
|
428
|
+
<span class="method-click-advice">click to toggle source</span>
|
429
|
+
</div>
|
430
|
+
|
431
|
+
|
432
|
+
<div class="method-description">
|
433
|
+
|
434
|
+
<p>Returns the depth of reads containing the non reference allele. IE the sum
|
435
|
+
of the last two figures in the DP4 attribute.</p>
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
<div class="method-source-code" id="non_ref_allele_count-source">
|
440
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 106</span>
|
441
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">non_ref_allele_count</span>
|
442
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">info</span>[<span class="ruby-string">"DP4"</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">","</span>)[<span class="ruby-value">2</span><span class="ruby-operator">..</span><span class="ruby-value">3</span>].<span class="ruby-identifier">inject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>,<span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sum</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_f</span> } <span class="ruby-keyword">rescue</span> <span class="ruby-value">0.0</span>
|
443
|
+
<span class="ruby-keyword">end</span></pre>
|
444
|
+
</div><!-- non_ref_allele_count-source -->
|
445
|
+
|
446
|
+
</div>
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
</div><!-- non_ref_allele_count-method -->
|
452
|
+
|
453
|
+
|
454
|
+
<div id="method-i-non_ref_allele_freq" class="method-detail ">
|
455
|
+
|
456
|
+
<div class="method-heading">
|
457
|
+
<span class="method-name">non_ref_allele_freq</span><span
|
458
|
+
class="method-args">()</span>
|
459
|
+
<span class="method-click-advice">click to toggle source</span>
|
460
|
+
</div>
|
461
|
+
|
462
|
+
|
463
|
+
<div class="method-description">
|
464
|
+
|
465
|
+
<p>Returns the non-reference allele frequency based on depth of reads used for
|
466
|
+
the genotype call,</p>
|
467
|
+
|
468
|
+
<p>IE</p>
|
469
|
+
|
470
|
+
<pre>vcf.non_ref_allele_count / vcf.used_depth</pre>
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
<div class="method-source-code" id="non_ref_allele_freq-source">
|
475
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 114</span>
|
476
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">non_ref_allele_freq</span>
|
477
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">non_ref_allele_count</span> <span class="ruby-operator">/</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">used_depth</span>
|
478
|
+
<span class="ruby-keyword">end</span></pre>
|
479
|
+
</div><!-- non_ref_allele_freq-source -->
|
480
|
+
|
481
|
+
</div>
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
</div><!-- non_ref_allele_freq-method -->
|
487
|
+
|
488
|
+
|
489
|
+
<div id="method-i-pass_quality-3F" class="method-detail ">
|
490
|
+
|
491
|
+
<div class="method-heading">
|
492
|
+
<span class="method-name">pass_quality?</span><span
|
493
|
+
class="method-args">(options)</span>
|
494
|
+
<span class="method-click-advice">click to toggle source</span>
|
495
|
+
</div>
|
496
|
+
|
497
|
+
|
498
|
+
<div class="method-description">
|
499
|
+
|
500
|
+
<p>Returns true if the position passes criteria</p>
|
501
|
+
|
502
|
+
<p>Options and Defaults:</p>
|
503
|
+
<ul><li>
|
504
|
+
<p>:min_depth => 2</p>
|
505
|
+
</li><li>
|
506
|
+
<p>:min_non_ref_count => 2</p>
|
507
|
+
</li><li>
|
508
|
+
<p>:mapping_quality => 10</p>
|
509
|
+
</li></ul>
|
510
|
+
|
511
|
+
<p>Example</p>
|
512
|
+
|
513
|
+
<pre class="ruby"><span class="ruby-identifier">vcf</span>.<span class="ruby-identifier">pass_quality?</span>(:<span class="ruby-identifier">min_depth</span> =<span class="ruby-operator">></span> <span class="ruby-value">5</span>, :<span class="ruby-identifier">min_non_ref_count</span> =<span class="ruby-operator">></span> <span class="ruby-value">2</span>, :<span class="ruby-identifier">mapping_quality</span> =<span class="ruby-operator">></span> <span class="ruby-value">25</span>)
|
514
|
+
</pre>
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
<div class="method-source-code" id="pass_quality-3F-source">
|
519
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 147</span>
|
520
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pass_quality?</span>(<span class="ruby-identifier">options</span>)
|
521
|
+
(<span class="ruby-keyword">self</span>.<span class="ruby-identifier">used_depth</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:min_depth</span>] <span class="ruby-keyword">and</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">mq</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:mapping_quality</span>] <span class="ruby-keyword">and</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">non_ref_allele_count</span> <span class="ruby-operator">>=</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:min_non_ref_count</span>])
|
522
|
+
<span class="ruby-keyword">end</span></pre>
|
523
|
+
</div><!-- pass_quality-3F-source -->
|
524
|
+
|
525
|
+
</div>
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
|
530
|
+
</div><!-- pass_quality-3F-method -->
|
531
|
+
|
532
|
+
|
533
|
+
<div id="method-i-pl" class="method-detail ">
|
534
|
+
|
535
|
+
<div class="method-heading">
|
536
|
+
<span class="method-name">pl</span><span
|
537
|
+
class="method-args">()</span>
|
538
|
+
<span class="method-click-advice">click to toggle source</span>
|
539
|
+
</div>
|
540
|
+
|
541
|
+
|
542
|
+
<div class="method-description">
|
543
|
+
|
544
|
+
<p>Returns the phred scaled likelihood of the first non-reference allele (as
|
545
|
+
defined by the <a href="Vcf.html">Vcf</a> PL attribute) for the first
|
546
|
+
sample in the <a href="Vcf.html">Vcf</a> only.</p>
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
<div class="method-source-code" id="pl-source">
|
551
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 129</span>
|
552
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">pl</span>
|
553
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">samples</span>[<span class="ruby-string">"1"</span>][<span class="ruby-string">"PL"</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">","</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-keyword">rescue</span> <span class="ruby-value">0.0</span>
|
554
|
+
<span class="ruby-keyword">end</span></pre>
|
555
|
+
</div><!-- pl-source -->
|
556
|
+
|
557
|
+
</div>
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
</div><!-- pl-method -->
|
563
|
+
|
564
|
+
|
565
|
+
<div id="method-i-to_s" class="method-detail ">
|
566
|
+
|
567
|
+
<div class="method-heading">
|
568
|
+
<span class="method-name">to_s</span><span
|
569
|
+
class="method-args">()</span>
|
570
|
+
<span class="method-click-advice">click to toggle source</span>
|
571
|
+
</div>
|
572
|
+
|
573
|
+
|
574
|
+
<div class="method-description">
|
575
|
+
|
576
|
+
<p>Return a short string representing chromosome, position, reference
|
577
|
+
sequence, alt sequence(s) and the info string of the <a
|
578
|
+
href="Vcf.html">Vcf</a> object.</p>
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
<div class="method-source-code" id="to_s-source">
|
583
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 85</span>
|
584
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
|
585
|
+
<span class="ruby-node">"#{self.chrom} #{self.pos} #{self.ref} #{self.alt} #{self.info}"</span>
|
586
|
+
<span class="ruby-keyword">end</span></pre>
|
587
|
+
</div><!-- to_s-source -->
|
588
|
+
|
589
|
+
</div>
|
590
|
+
|
591
|
+
|
592
|
+
|
593
|
+
|
594
|
+
</div><!-- to_s-method -->
|
595
|
+
|
596
|
+
|
597
|
+
<div id="method-i-used_depth" class="method-detail ">
|
598
|
+
|
599
|
+
<div class="method-heading">
|
600
|
+
<span class="method-name">used_depth</span><span
|
601
|
+
class="method-args">()</span>
|
602
|
+
<span class="method-click-advice">click to toggle source</span>
|
603
|
+
</div>
|
604
|
+
|
605
|
+
|
606
|
+
<div class="method-description">
|
607
|
+
|
608
|
+
<p>The depth of reads actually used in the genotype call by Vcftools. The sum
|
609
|
+
of the DP4 attribute. Returns 0.0 if no value is calculated.</p>
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
<div class="method-source-code" id="used_depth-source">
|
614
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 90</span>
|
615
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">used_depth</span>
|
616
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">info</span>[<span class="ruby-string">"DP4"</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">","</span>).<span class="ruby-identifier">inject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>,<span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sum</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_f</span>} <span class="ruby-keyword">rescue</span> <span class="ruby-value">0.0</span>
|
617
|
+
<span class="ruby-keyword">end</span></pre>
|
618
|
+
</div><!-- used_depth-source -->
|
619
|
+
|
620
|
+
</div>
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
</div><!-- used_depth-method -->
|
626
|
+
|
627
|
+
|
628
|
+
<div id="method-i-variant-3F" class="method-detail ">
|
629
|
+
|
630
|
+
<div class="method-heading">
|
631
|
+
<span class="method-name">variant?</span><span
|
632
|
+
class="method-args">()</span>
|
633
|
+
<span class="method-click-advice">click to toggle source</span>
|
634
|
+
</div>
|
635
|
+
|
636
|
+
|
637
|
+
<div class="method-description">
|
638
|
+
|
639
|
+
<p>returns true if the <code>alt</code> column of the <a
|
640
|
+
href="Vcf.html">Vcf</a> is not <strong>.</strong></p>
|
641
|
+
|
642
|
+
<p>Examples</p>
|
643
|
+
|
644
|
+
<p>vcf record = 20 14370 rs6054257 G A 29 PASS …</p>
|
645
|
+
|
646
|
+
<pre class="ruby"><span class="ruby-identifier">vcf</span>.<span class="ruby-identifier">variant?</span> <span class="ruby-comment">#=> true</span>
|
647
|
+
</pre>
|
648
|
+
|
649
|
+
<p>vcf record = 20 1230237 . T . 47 PASS …</p>
|
650
|
+
|
651
|
+
<pre class="ruby"><span class="ruby-identifier">vcf</span>.<span class="ruby-identifier">variant?</span> <span class="ruby-comment">#=> false</span>
|
652
|
+
</pre>
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
<div class="method-source-code" id="variant-3F-source">
|
657
|
+
<pre><span class="ruby-comment"># File lib/bio/util/bio-gngm.rb, line 80</span>
|
658
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">variant?</span>
|
659
|
+
<span class="ruby-keyword">not</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">alt</span> <span class="ruby-operator">==</span> <span class="ruby-string">"."</span> <span class="ruby-keyword">rescue</span> <span class="ruby-keyword">false</span>
|
660
|
+
<span class="ruby-keyword">end</span></pre>
|
661
|
+
</div><!-- variant-3F-source -->
|
662
|
+
|
663
|
+
</div>
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
</div><!-- variant-3F-method -->
|
669
|
+
|
670
|
+
|
671
|
+
</section><!-- public-instance-method-details -->
|
672
|
+
|
673
|
+
</section><!-- 5Buntitled-5D -->
|
674
|
+
|
675
|
+
</div><!-- documentation -->
|
676
|
+
|
677
|
+
|
678
|
+
<footer id="validator-badges">
|
679
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
680
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
|
681
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
682
|
+
</footer>
|
683
|
+
|