bio-samtools 0.6.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +3 -2
- data/README.md +4 -7
- data/VERSION +1 -1
- data/bio-samtools.gemspec +47 -105
- data/doc/Bio.html +68 -131
- data/doc/Bio/DB.html +51 -111
- data/doc/Bio/DB/Alignment.html +135 -363
- data/doc/Bio/DB/Pileup.html +183 -170
- data/doc/Bio/DB/SAM.html +1396 -820
- data/doc/Bio/DB/SAM/Library.html +73 -123
- data/doc/Bio/DB/SAM/Tools.html +51 -273
- data/doc/Bio/DB/Tag.html +78 -124
- data/doc/Bio/DB/Vcf.html +111 -147
- data/doc/LICENSE_txt.html +113 -148
- data/doc/created.rid +9 -10
- data/doc/fonts.css +167 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/index.html +48 -54
- data/doc/js/darkfish.js +9 -22
- data/doc/js/search.js +20 -5
- data/doc/js/search_index.js +1 -1
- data/doc/rdoc.css +255 -218
- data/doc/table_of_contents.html +256 -137
- data/ext/Rakefile +57 -0
- data/lib/bio-samtools.rb +7 -2
- data/lib/bio/BIOExtensions.rb +89 -0
- data/lib/bio/db/alignment.rb +59 -0
- data/lib/bio/db/fastadb.rb +255 -0
- data/lib/bio/db/pileup.rb +221 -172
- data/lib/bio/db/sam.rb +639 -589
- data/lib/bio/db/sam/{faidx.rb → faidx_old.rb} +0 -0
- data/lib/bio/db/vcf.rb +69 -68
- data/test/.gitignore +1 -0
- data/test/{test_basic.rb → old_test_basic.rb} +33 -1
- data/test/samples/small/dupes.bam +0 -0
- data/test/samples/small/dupes.sam +274 -0
- data/test/samples/small/map_for_reheader.sam +8 -0
- data/test/samples/small/map_to_merge1.bam +0 -0
- data/test/samples/small/map_to_merge1.bam.bai +0 -0
- data/test/samples/small/map_to_merge1.sam +8 -0
- data/test/samples/small/map_to_merge2.bam +0 -0
- data/test/samples/small/map_to_merge2.bam.bai +0 -0
- data/test/samples/small/map_to_merge2.sam +8 -0
- data/test/samples/small/no_md.sam +8 -0
- data/test/samples/small/test_chr.fasta.1.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.2.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.3.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.4.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.rev.1.bt2 +0 -0
- data/test/samples/small/test_chr.fasta.rev.2.bt2 +0 -0
- data/test/samples/small/test_cov.svg +273 -0
- data/test/samples/small/testu.bam.bai +0 -0
- data/test/svg +133 -0
- data/test/test_pileup.rb +84 -0
- data/test/test_sam.rb +331 -0
- data/test/test_vcf.rb +11 -0
- data/{doc → tutorial}/tutorial.html +0 -0
- data/{doc → tutorial}/tutorial.pdf +0 -0
- metadata +56 -114
- data/doc/Bio/DB/SAM/Tools/Bam1CoreT.html +0 -159
- data/doc/Bio/DB/SAM/Tools/Bam1T.html +0 -220
- data/doc/Bio/DB/SAM/Tools/BamHeaderT.html +0 -249
- data/doc/Bio/DB/SAM/Tools/BamPileup1T.html +0 -159
- data/doc/Bio/DB/SAM/Tools/SamfileT.html +0 -171
- data/doc/Bio/DB/SAM/Tools/SamfileTX.html +0 -159
- data/doc/Bio/DB/SAMException.html +0 -205
- data/doc/LibC.html +0 -155
- data/doc/Pileup.html +0 -571
- data/doc/Vcf.html +0 -473
- data/doc/basic_styles.css +0 -31
- data/doc/classes/Bio.html +0 -139
- data/doc/classes/Bio/DB.html +0 -137
- data/doc/classes/Bio/DB/Alignment.html +0 -441
- data/doc/classes/Bio/DB/Alignment.src/M000012.html +0 -19
- data/doc/classes/Bio/DB/Alignment.src/M000013.html +0 -27
- data/doc/classes/Bio/DB/Alignment.src/M000014.html +0 -45
- data/doc/classes/Bio/DB/Alignment.src/M000015.html +0 -40
- data/doc/classes/Bio/DB/SAM.html +0 -510
- data/doc/classes/Bio/DB/SAM/Library.html +0 -135
- data/doc/classes/Bio/DB/SAM/Library.src/M000006.html +0 -28
- data/doc/classes/Bio/DB/SAM/Tools.html +0 -278
- data/doc/classes/Bio/DB/SAM/Tools.src/M000007.html +0 -20
- data/doc/classes/Bio/DB/SAM/Tools/Bam1CoreT.html +0 -111
- data/doc/classes/Bio/DB/SAM/Tools/Bam1T.html +0 -150
- data/doc/classes/Bio/DB/SAM/Tools/Bam1T.src/M000010.html +0 -20
- data/doc/classes/Bio/DB/SAM/Tools/BamHeaderT.html +0 -169
- data/doc/classes/Bio/DB/SAM/Tools/BamHeaderT.src/M000008.html +0 -19
- data/doc/classes/Bio/DB/SAM/Tools/BamHeaderT.src/M000009.html +0 -18
- data/doc/classes/Bio/DB/SAM/Tools/BamPileup1T.html +0 -111
- data/doc/classes/Bio/DB/SAM/Tools/SamfileT.html +0 -129
- data/doc/classes/Bio/DB/SAM/Tools/SamfileTX.html +0 -111
- data/doc/classes/Bio/DB/SAMException.html +0 -140
- data/doc/classes/Bio/DB/SAMException.src/M000016.html +0 -18
- data/doc/classes/Bio/DB/Sam.src/M000017.html +0 -43
- data/doc/classes/Bio/DB/Sam.src/M000018.html +0 -42
- data/doc/classes/Bio/DB/Sam.src/M000019.html +0 -18
- data/doc/classes/Bio/DB/Sam.src/M000020.html +0 -22
- data/doc/classes/Bio/DB/Sam.src/M000021.html +0 -19
- data/doc/classes/Bio/DB/Sam.src/M000022.html +0 -25
- data/doc/classes/Bio/DB/Sam.src/M000023.html +0 -28
- data/doc/classes/Bio/DB/Sam.src/M000024.html +0 -28
- data/doc/classes/Bio/DB/Sam.src/M000025.html +0 -46
- data/doc/classes/Bio/DB/Sam.src/M000026.html +0 -24
- data/doc/classes/Bio/DB/Sam.src/M000027.html +0 -19
- data/doc/classes/Bio/DB/Sam.src/M000028.html +0 -24
- data/doc/classes/Bio/DB/Sam.src/M000029.html +0 -41
- data/doc/classes/Bio/DB/Sam.src/M000030.html +0 -31
- data/doc/classes/Bio/DB/Sam.src/M000031.html +0 -86
- data/doc/classes/Bio/DB/Sam.src/M000032.html +0 -34
- data/doc/classes/Bio/DB/Tag.html +0 -160
- data/doc/classes/Bio/DB/Tag.src/M000011.html +0 -21
- data/doc/classes/LibC.html +0 -105
- data/doc/classes/Pileup.html +0 -374
- data/doc/classes/Pileup.src/M000001.html +0 -34
- data/doc/classes/Pileup.src/M000002.html +0 -21
- data/doc/classes/Pileup.src/M000003.html +0 -21
- data/doc/classes/Pileup.src/M000004.html +0 -21
- data/doc/classes/Pileup.src/M000005.html +0 -31
- data/doc/files/lib/bio-samtools_rb.html +0 -109
- data/doc/files/lib/bio/db/sam/bam_rb.html +0 -108
- data/doc/files/lib/bio/db/sam/faidx_rb.html +0 -108
- data/doc/files/lib/bio/db/sam/library_rb.html +0 -101
- data/doc/files/lib/bio/db/sam/pileup_rb.html +0 -178
- data/doc/files/lib/bio/db/sam/sam_rb.html +0 -113
- data/doc/files/lib/bio/db/sam_rb.html +0 -111
- data/doc/fr_class_index.html +0 -43
- data/doc/fr_file_index.html +0 -33
- data/doc/fr_method_index.html +0 -58
- data/doc/lib/bio-samtools_rb.html +0 -115
- data/doc/lib/bio/db/pileup_rb.html +0 -171
- data/doc/lib/bio/db/sam/bam_rb.html +0 -121
- data/doc/lib/bio/db/sam/faidx_rb.html +0 -117
- data/doc/lib/bio/db/sam/library_rb.html +0 -115
- data/doc/lib/bio/db/sam/pileup_rb.html +0 -171
- data/doc/lib/bio/db/sam/sam_rb.html +0 -121
- data/doc/lib/bio/db/sam/vcf_rb.html +0 -124
- data/doc/lib/bio/db/sam_rb.html +0 -115
- data/doc/lib/bio/db/vcf_rb.html +0 -124
- data/doc/rdoc-style.css +0 -208
- data/lib/bio/db/sam/bam.rb +0 -210
- data/lib/bio/db/sam/sam.rb +0 -86
- data/test/samples/pipe_char/test.bam +0 -0
- data/test/samples/pipe_char/test.bam.bai +0 -0
- data/test/samples/pipe_char/test.tam +0 -10
- data/test/samples/pipe_char/test_chr.fasta +0 -1000
- data/test/samples/pipe_char/test_chr.fasta.fai +0 -1
- data/test/samples/small/test +0 -0
- data/test/samples/small/test.bam +0 -0
- data/test/samples/small/test.fa +0 -20
- data/test/samples/small/test.fai +0 -0
data/doc/Bio/DB/Tag.html
CHANGED
|
@@ -2,145 +2,96 @@
|
|
|
2
2
|
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
|
-
<meta
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
6
|
|
|
7
7
|
<title>class Bio::DB::Tag - Pileup</title>
|
|
8
8
|
|
|
9
|
-
<link
|
|
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
|
|
16
|
-
<script
|
|
17
|
-
<script
|
|
18
|
-
<script
|
|
19
|
-
<script
|
|
20
|
-
<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
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
</
|
|
31
|
-
</
|
|
32
|
-
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
35
40
|
<form action="#" method="get" accept-charset="utf-8">
|
|
36
|
-
<
|
|
37
|
-
<input
|
|
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
|
-
</
|
|
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/sam.rb
|
|
51
|
-
</ul>
|
|
52
|
-
</nav>
|
|
53
|
-
|
|
54
|
-
|
|
55
54
|
</div>
|
|
56
55
|
|
|
56
|
+
|
|
57
|
+
|
|
57
58
|
<div id="class-metadata">
|
|
58
59
|
|
|
59
|
-
<
|
|
60
|
-
<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
|
-
</
|
|
66
|
+
</div>
|
|
65
67
|
|
|
66
68
|
|
|
69
|
+
|
|
67
70
|
<!-- Method Quickref -->
|
|
68
|
-
<
|
|
69
|
-
<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-i-set">#set</a>
|
|
76
|
+
<li ><a href="#method-i-set">#set</a>
|
|
74
77
|
|
|
75
78
|
</ul>
|
|
76
|
-
</
|
|
79
|
+
</div>
|
|
77
80
|
|
|
78
81
|
</div>
|
|
79
|
-
|
|
80
|
-
<div id="project-metadata">
|
|
81
|
-
<nav id="fileindex-section" class="section project-section">
|
|
82
|
-
<h3 class="section-header">Pages</h3>
|
|
83
|
-
|
|
84
|
-
<ul>
|
|
85
|
-
|
|
86
|
-
<li class="file"><a href="../../LICENSE_txt.html">LICENSE</a>
|
|
87
|
-
|
|
88
|
-
</ul>
|
|
89
82
|
</nav>
|
|
90
83
|
|
|
91
|
-
|
|
92
|
-
<
|
|
84
|
+
<main role="main" aria-labelledby="class-Bio::DB::Tag">
|
|
85
|
+
<h1 id="class-Bio::DB::Tag" class="class">
|
|
86
|
+
class Bio::DB::Tag
|
|
87
|
+
</h1>
|
|
93
88
|
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
<li><a href="../../Bio.html">Bio</a>
|
|
97
|
-
|
|
98
|
-
<li><a href="../../Bio/DB.html">Bio::DB</a>
|
|
99
|
-
|
|
100
|
-
<li><a href="../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
|
|
101
|
-
|
|
102
|
-
<li><a href="../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
|
|
103
|
-
|
|
104
|
-
<li><a href="../../Bio/DB/SAM.html">Bio::DB::SAM</a>
|
|
105
|
-
|
|
106
|
-
<li><a href="../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
|
|
107
|
-
|
|
108
|
-
<li><a href="../../Bio/DB/SAM/Tools.html">Bio::DB::SAM::Tools</a>
|
|
109
|
-
|
|
110
|
-
<li><a href="../../Bio/DB/SAM/Tools/Bam1CoreT.html">Bio::DB::SAM::Tools::Bam1CoreT</a>
|
|
111
|
-
|
|
112
|
-
<li><a href="../../Bio/DB/SAM/Tools/Bam1T.html">Bio::DB::SAM::Tools::Bam1T</a>
|
|
113
|
-
|
|
114
|
-
<li><a href="../../Bio/DB/SAM/Tools/BamHeaderT.html">Bio::DB::SAM::Tools::BamHeaderT</a>
|
|
115
|
-
|
|
116
|
-
<li><a href="../../Bio/DB/SAM/Tools/BamPileup1T.html">Bio::DB::SAM::Tools::BamPileup1T</a>
|
|
117
|
-
|
|
118
|
-
<li><a href="../../Bio/DB/SAM/Tools/SamfileT.html">Bio::DB::SAM::Tools::SamfileT</a>
|
|
119
|
-
|
|
120
|
-
<li><a href="../../Bio/DB/SAM/Tools/SamfileTX.html">Bio::DB::SAM::Tools::SamfileTX</a>
|
|
121
|
-
|
|
122
|
-
<li><a href="../../Bio/DB/SAMException.html">Bio::DB::SAMException</a>
|
|
123
|
-
|
|
124
|
-
<li><a href="../../Bio/DB/Sam.html">Bio::DB::Sam</a>
|
|
125
|
-
|
|
126
|
-
<li><a href="../../Bio/DB/Tag.html">Bio::DB::Tag</a>
|
|
127
|
-
|
|
128
|
-
<li><a href="../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
|
|
129
|
-
|
|
130
|
-
<li><a href="../../LibC.html">LibC</a>
|
|
131
|
-
|
|
132
|
-
</ul>
|
|
133
|
-
</nav>
|
|
134
|
-
|
|
135
|
-
</div>
|
|
136
|
-
</nav>
|
|
137
|
-
|
|
138
|
-
<div id="documentation">
|
|
139
|
-
<h1 class="class">class Bio::DB::Tag</h1>
|
|
140
|
-
|
|
141
|
-
<div id="description" class="description">
|
|
89
|
+
<section class="description">
|
|
142
90
|
|
|
143
|
-
|
|
91
|
+
<p>a class to represent the SAM OPT values, presented in SAM as
|
|
92
|
+
TAG:VTYPE:VALUE</p>
|
|
93
|
+
|
|
94
|
+
</section>
|
|
144
95
|
|
|
145
96
|
|
|
146
97
|
|
|
@@ -153,9 +104,10 @@
|
|
|
153
104
|
|
|
154
105
|
|
|
155
106
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
107
|
+
<section class="attribute-method-details" class="method-section">
|
|
108
|
+
<header>
|
|
109
|
+
<h3>Attributes</h3>
|
|
110
|
+
</header>
|
|
159
111
|
|
|
160
112
|
|
|
161
113
|
<div id="attribute-i-tag" class="method-detail">
|
|
@@ -197,13 +149,14 @@
|
|
|
197
149
|
</div>
|
|
198
150
|
</div>
|
|
199
151
|
|
|
200
|
-
</section
|
|
152
|
+
</section>
|
|
201
153
|
|
|
202
154
|
|
|
203
|
-
<!-- Methods -->
|
|
204
155
|
|
|
205
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section
|
|
206
|
-
|
|
156
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
157
|
+
<header>
|
|
158
|
+
<h3>Public Instance Methods</h3>
|
|
159
|
+
</header>
|
|
207
160
|
|
|
208
161
|
|
|
209
162
|
<div id="method-i-set" class="method-detail ">
|
|
@@ -211,7 +164,9 @@
|
|
|
211
164
|
<div class="method-heading">
|
|
212
165
|
<span class="method-name">set</span><span
|
|
213
166
|
class="method-args">(str)</span>
|
|
167
|
+
|
|
214
168
|
<span class="method-click-advice">click to toggle source</span>
|
|
169
|
+
|
|
215
170
|
</div>
|
|
216
171
|
|
|
217
172
|
|
|
@@ -219,36 +174,35 @@
|
|
|
219
174
|
|
|
220
175
|
|
|
221
176
|
|
|
177
|
+
|
|
222
178
|
|
|
223
179
|
|
|
224
180
|
<div class="method-source-code" id="set-source">
|
|
225
|
-
<pre><span class="ruby-comment"># File lib/bio/db/
|
|
181
|
+
<pre><span class="ruby-comment"># File lib/bio/db/alignment.rb, line 7</span>
|
|
226
182
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set</span>(<span class="ruby-identifier">str</span>)
|
|
227
|
-
<span class="ruby-
|
|
228
|
-
<span class="ruby-ivar">@
|
|
229
|
-
<span class="ruby-ivar">@
|
|
230
|
-
<span class="ruby-ivar">@value</span> = <span class="ruby-identifier">v</span>[<span class="ruby-value">2</span>]
|
|
183
|
+
<span class="ruby-ivar">@tag</span> = <span class="ruby-identifier">str</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>]
|
|
184
|
+
<span class="ruby-ivar">@type</span> = <span class="ruby-identifier">str</span>[<span class="ruby-value">3</span>]
|
|
185
|
+
<span class="ruby-ivar">@value</span> = <span class="ruby-identifier">str</span>[<span class="ruby-value">5</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
231
186
|
<span class="ruby-keyword">end</span></pre>
|
|
232
|
-
</div
|
|
187
|
+
</div>
|
|
233
188
|
|
|
234
189
|
</div>
|
|
235
190
|
|
|
236
191
|
|
|
237
192
|
|
|
238
193
|
|
|
239
|
-
</div
|
|
194
|
+
</div>
|
|
240
195
|
|
|
241
196
|
|
|
242
|
-
</section
|
|
197
|
+
</section>
|
|
243
198
|
|
|
244
|
-
</section
|
|
245
|
-
|
|
246
|
-
</div><!-- documentation -->
|
|
199
|
+
</section>
|
|
200
|
+
</main>
|
|
247
201
|
|
|
248
202
|
|
|
249
|
-
<footer id="validator-badges">
|
|
250
|
-
<p><a href="http://validator.w3.org/check/referer">
|
|
251
|
-
<p>Generated by <a href="
|
|
252
|
-
<p>
|
|
203
|
+
<footer id="validator-badges" role="contentinfo">
|
|
204
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
205
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
|
206
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
253
207
|
</footer>
|
|
254
208
|
|
data/doc/Bio/DB/Vcf.html
CHANGED
|
@@ -2,149 +2,97 @@
|
|
|
2
2
|
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
|
-
<meta
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
6
|
|
|
7
7
|
<title>class Bio::DB::Vcf - Pileup</title>
|
|
8
8
|
|
|
9
|
-
<link
|
|
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
|
|
16
|
-
<script
|
|
17
|
-
<script
|
|
18
|
-
<script
|
|
19
|
-
<script
|
|
20
|
-
<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
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
</
|
|
31
|
-
</
|
|
32
|
-
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
35
40
|
<form action="#" method="get" accept-charset="utf-8">
|
|
36
|
-
<
|
|
37
|
-
<input
|
|
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
|
-
</
|
|
40
|
-
</form>
|
|
46
|
+
</div>
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<nav id="file-list-section" class="section">
|
|
48
|
-
<h3 class="section-header">Defined In</h3>
|
|
49
|
-
<ul>
|
|
50
|
-
<li>lib/bio/db/vcf.rb
|
|
51
|
-
</ul>
|
|
52
|
-
</nav>
|
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
51
|
+
</form>
|
|
52
|
+
</div>
|
|
53
53
|
|
|
54
|
-
|
|
55
54
|
</div>
|
|
56
55
|
|
|
56
|
+
|
|
57
|
+
|
|
57
58
|
<div id="class-metadata">
|
|
58
59
|
|
|
59
|
-
<
|
|
60
|
-
<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
|
-
</
|
|
66
|
+
</div>
|
|
65
67
|
|
|
66
68
|
|
|
69
|
+
|
|
67
70
|
<!-- Method Quickref -->
|
|
68
|
-
<
|
|
69
|
-
<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-new">::new</a>
|
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
|
74
77
|
|
|
75
|
-
<li><a href="#method-i-int_or_raw">#int_or_raw</a>
|
|
78
|
+
<li ><a href="#method-i-int_or_raw">#int_or_raw</a>
|
|
76
79
|
|
|
77
|
-
<li><a href="#method-i-parse_line">#parse_line</a>
|
|
80
|
+
<li ><a href="#method-i-parse_line">#parse_line</a>
|
|
78
81
|
|
|
79
82
|
</ul>
|
|
80
|
-
</
|
|
81
|
-
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
<div id="project-metadata">
|
|
85
|
-
<nav id="fileindex-section" class="section project-section">
|
|
86
|
-
<h3 class="section-header">Pages</h3>
|
|
87
|
-
|
|
88
|
-
<ul>
|
|
89
|
-
|
|
90
|
-
<li class="file"><a href="../../LICENSE_txt.html">LICENSE</a>
|
|
91
|
-
|
|
92
|
-
</ul>
|
|
93
|
-
</nav>
|
|
94
|
-
|
|
95
|
-
<nav id="classindex-section" class="section project-section">
|
|
96
|
-
<h3 class="section-header">Class and Module Index</h3>
|
|
97
|
-
|
|
98
|
-
<ul class="link-list">
|
|
99
|
-
|
|
100
|
-
<li><a href="../../Bio.html">Bio</a>
|
|
101
|
-
|
|
102
|
-
<li><a href="../../Bio/DB.html">Bio::DB</a>
|
|
103
|
-
|
|
104
|
-
<li><a href="../../Bio/DB/Alignment.html">Bio::DB::Alignment</a>
|
|
105
|
-
|
|
106
|
-
<li><a href="../../Bio/DB/Pileup.html">Bio::DB::Pileup</a>
|
|
107
|
-
|
|
108
|
-
<li><a href="../../Bio/DB/SAM.html">Bio::DB::SAM</a>
|
|
109
|
-
|
|
110
|
-
<li><a href="../../Bio/DB/SAM/Library.html">Bio::DB::SAM::Library</a>
|
|
111
|
-
|
|
112
|
-
<li><a href="../../Bio/DB/SAM/Tools.html">Bio::DB::SAM::Tools</a>
|
|
113
|
-
|
|
114
|
-
<li><a href="../../Bio/DB/SAM/Tools/Bam1CoreT.html">Bio::DB::SAM::Tools::Bam1CoreT</a>
|
|
115
|
-
|
|
116
|
-
<li><a href="../../Bio/DB/SAM/Tools/Bam1T.html">Bio::DB::SAM::Tools::Bam1T</a>
|
|
117
|
-
|
|
118
|
-
<li><a href="../../Bio/DB/SAM/Tools/BamHeaderT.html">Bio::DB::SAM::Tools::BamHeaderT</a>
|
|
119
|
-
|
|
120
|
-
<li><a href="../../Bio/DB/SAM/Tools/BamPileup1T.html">Bio::DB::SAM::Tools::BamPileup1T</a>
|
|
121
|
-
|
|
122
|
-
<li><a href="../../Bio/DB/SAM/Tools/SamfileT.html">Bio::DB::SAM::Tools::SamfileT</a>
|
|
123
|
-
|
|
124
|
-
<li><a href="../../Bio/DB/SAM/Tools/SamfileTX.html">Bio::DB::SAM::Tools::SamfileTX</a>
|
|
125
|
-
|
|
126
|
-
<li><a href="../../Bio/DB/SAMException.html">Bio::DB::SAMException</a>
|
|
127
|
-
|
|
128
|
-
<li><a href="../../Bio/DB/Sam.html">Bio::DB::Sam</a>
|
|
129
|
-
|
|
130
|
-
<li><a href="../../Bio/DB/Tag.html">Bio::DB::Tag</a>
|
|
131
|
-
|
|
132
|
-
<li><a href="../../Bio/DB/Vcf.html">Bio::DB::Vcf</a>
|
|
133
|
-
|
|
134
|
-
<li><a href="../../LibC.html">LibC</a>
|
|
135
|
-
|
|
136
|
-
</ul>
|
|
137
|
-
</nav>
|
|
83
|
+
</div>
|
|
138
84
|
|
|
139
85
|
</div>
|
|
140
86
|
</nav>
|
|
141
87
|
|
|
142
|
-
<
|
|
143
|
-
<h1
|
|
88
|
+
<main role="main" aria-labelledby="class-Bio::DB::Vcf">
|
|
89
|
+
<h1 id="class-Bio::DB::Vcf" class="class">
|
|
90
|
+
class Bio::DB::Vcf
|
|
91
|
+
</h1>
|
|
144
92
|
|
|
145
|
-
<
|
|
93
|
+
<section class="description">
|
|
146
94
|
|
|
147
|
-
</
|
|
95
|
+
</section>
|
|
148
96
|
|
|
149
97
|
|
|
150
98
|
|
|
@@ -157,9 +105,10 @@
|
|
|
157
105
|
|
|
158
106
|
|
|
159
107
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
108
|
+
<section class="attribute-method-details" class="method-section">
|
|
109
|
+
<header>
|
|
110
|
+
<h3>Attributes</h3>
|
|
111
|
+
</header>
|
|
163
112
|
|
|
164
113
|
|
|
165
114
|
<div id="attribute-i-alt" class="method-detail">
|
|
@@ -292,13 +241,14 @@
|
|
|
292
241
|
</div>
|
|
293
242
|
</div>
|
|
294
243
|
|
|
295
|
-
</section
|
|
244
|
+
</section>
|
|
296
245
|
|
|
297
246
|
|
|
298
|
-
<!-- Methods -->
|
|
299
247
|
|
|
300
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section
|
|
301
|
-
|
|
248
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
249
|
+
<header>
|
|
250
|
+
<h3>Public Class Methods</h3>
|
|
251
|
+
</header>
|
|
302
252
|
|
|
303
253
|
|
|
304
254
|
<div id="method-c-new" class="method-detail ">
|
|
@@ -306,16 +256,20 @@
|
|
|
306
256
|
<div class="method-heading">
|
|
307
257
|
<span class="method-name">new</span><span
|
|
308
258
|
class="method-args">(line=nil, sample_names=nil)</span>
|
|
259
|
+
|
|
309
260
|
<span class="method-click-advice">click to toggle source</span>
|
|
261
|
+
|
|
310
262
|
</div>
|
|
311
263
|
|
|
312
264
|
|
|
313
265
|
<div class="method-description">
|
|
314
266
|
|
|
315
267
|
<p>create the vcf object, use the ordered list of sample names to label
|
|
316
|
-
samples if provided [
|
|
317
|
-
|
|
318
|
-
|
|
268
|
+
samples if provided ['A', 'B', 'C'], otherwise
|
|
269
|
+
uses, 1,2,3 etc</p>
|
|
270
|
+
|
|
271
|
+
<pre>vcf = Bio::DB::Vcf("19 111 . A C 9.6 . . GT:HQ 0|0:10,10 0|0:10,10 0/1:3,3")</pre>
|
|
272
|
+
|
|
319
273
|
|
|
320
274
|
|
|
321
275
|
|
|
@@ -326,20 +280,22 @@ GT:HQ 0|0:10,10 0|0:10,10 0/1:3,3”)</p>
|
|
|
326
280
|
<span class="ruby-ivar">@samples</span> = {}
|
|
327
281
|
<span class="ruby-identifier">parse_line</span>(<span class="ruby-identifier">line</span>, <span class="ruby-identifier">sample_names</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
|
|
328
282
|
<span class="ruby-keyword">end</span></pre>
|
|
329
|
-
</div
|
|
283
|
+
</div>
|
|
330
284
|
|
|
331
285
|
</div>
|
|
332
286
|
|
|
333
287
|
|
|
334
288
|
|
|
335
289
|
|
|
336
|
-
</div
|
|
290
|
+
</div>
|
|
337
291
|
|
|
338
292
|
|
|
339
|
-
</section
|
|
293
|
+
</section>
|
|
340
294
|
|
|
341
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section
|
|
342
|
-
|
|
295
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
296
|
+
<header>
|
|
297
|
+
<h3>Public Instance Methods</h3>
|
|
298
|
+
</header>
|
|
343
299
|
|
|
344
300
|
|
|
345
301
|
<div id="method-i-int_or_raw" class="method-detail ">
|
|
@@ -347,29 +303,35 @@ GT:HQ 0|0:10,10 0|0:10,10 0/1:3,3”)</p>
|
|
|
347
303
|
<div class="method-heading">
|
|
348
304
|
<span class="method-name">int_or_raw</span><span
|
|
349
305
|
class="method-args">(x)</span>
|
|
306
|
+
|
|
350
307
|
<span class="method-click-advice">click to toggle source</span>
|
|
308
|
+
|
|
351
309
|
</div>
|
|
352
310
|
|
|
353
311
|
|
|
354
312
|
<div class="method-description">
|
|
355
313
|
|
|
314
|
+
<p>tests if the current variable is an Integer</p>
|
|
315
|
+
<ul><li>
|
|
316
|
+
<p>x - any variable</p>
|
|
317
|
+
</li></ul>
|
|
356
318
|
|
|
357
319
|
|
|
358
320
|
|
|
359
321
|
|
|
360
322
|
<div class="method-source-code" id="int_or_raw-source">
|
|
361
|
-
<pre><span class="ruby-comment"># File lib/bio/db/vcf.rb, line
|
|
323
|
+
<pre><span class="ruby-comment"># File lib/bio/db/vcf.rb, line 23</span>
|
|
362
324
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">int_or_raw</span>(<span class="ruby-identifier">x</span>)
|
|
363
325
|
<span class="ruby-constant">Integer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">x</span>) <span class="ruby-keyword">rescue</span> <span class="ruby-identifier">x</span>
|
|
364
326
|
<span class="ruby-keyword">end</span></pre>
|
|
365
|
-
</div
|
|
327
|
+
</div>
|
|
366
328
|
|
|
367
329
|
</div>
|
|
368
330
|
|
|
369
331
|
|
|
370
332
|
|
|
371
333
|
|
|
372
|
-
</div
|
|
334
|
+
</div>
|
|
373
335
|
|
|
374
336
|
|
|
375
337
|
<div id="method-i-parse_line" class="method-detail ">
|
|
@@ -377,7 +339,9 @@ GT:HQ 0|0:10,10 0|0:10,10 0/1:3,3”)</p>
|
|
|
377
339
|
<div class="method-heading">
|
|
378
340
|
<span class="method-name">parse_line</span><span
|
|
379
341
|
class="method-args">(line, sample_names=nil)</span>
|
|
342
|
+
|
|
380
343
|
<span class="method-click-advice">click to toggle source</span>
|
|
344
|
+
|
|
381
345
|
</div>
|
|
382
346
|
|
|
383
347
|
|
|
@@ -386,52 +350,53 @@ GT:HQ 0|0:10,10 0|0:10,10 0/1:3,3”)</p>
|
|
|
386
350
|
<p>gets the info in the <a href="Vcf.html">Vcf</a> lines and parses it,
|
|
387
351
|
setting the attributes</p>
|
|
388
352
|
|
|
353
|
+
|
|
389
354
|
|
|
390
355
|
|
|
391
356
|
<div class="method-source-code" id="parse_line-source">
|
|
392
|
-
<pre><span class="ruby-comment"># File lib/bio/db/vcf.rb, line
|
|
357
|
+
<pre><span class="ruby-comment"># File lib/bio/db/vcf.rb, line 28</span>
|
|
393
358
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">parse_line</span>(<span class="ruby-identifier">line</span>, <span class="ruby-identifier">sample_names</span>=<span class="ruby-keyword">nil</span>)
|
|
394
|
-
<span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-string"
|
|
395
|
-
|
|
359
|
+
<span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-string">'#'</span>
|
|
360
|
+
|
|
396
361
|
<span class="ruby-identifier">f</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">"\t"</span>, <span class="ruby-value">-1</span>)
|
|
397
362
|
<span class="ruby-identifier">raise</span> <span class="ruby-string">"VCF lines must have at least 8 fields"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-value">8</span>
|
|
398
363
|
<span class="ruby-ivar">@chrom</span> = <span class="ruby-identifier">f</span>[<span class="ruby-value">0</span>]
|
|
399
364
|
<span class="ruby-ivar">@pos</span> = <span class="ruby-identifier">f</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span>
|
|
400
|
-
<span class="ruby-ivar">@id</span> = <span class="ruby-string"
|
|
365
|
+
<span class="ruby-ivar">@id</span> = <span class="ruby-string">'.'</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">f</span>[<span class="ruby-value">2</span>] <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">f</span>[<span class="ruby-value">2</span>]
|
|
401
366
|
<span class="ruby-ivar">@ref</span> = <span class="ruby-identifier">f</span>[<span class="ruby-value">3</span>]
|
|
402
367
|
<span class="ruby-ivar">@alt</span> = <span class="ruby-identifier">f</span>[<span class="ruby-value">4</span>]
|
|
403
368
|
<span class="ruby-ivar">@qual</span> = <span class="ruby-identifier">f</span>[<span class="ruby-value">5</span>].<span class="ruby-identifier">to_f</span>
|
|
404
|
-
<span class="ruby-ivar">@filter</span> = <span class="ruby-string"
|
|
405
|
-
|
|
406
|
-
<span class="ruby-ivar">@info</span> = <span class="ruby-string"
|
|
369
|
+
<span class="ruby-ivar">@filter</span> = <span class="ruby-string">'.'</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">f</span>[<span class="ruby-value">6</span>] <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">f</span>[<span class="ruby-value">6</span>]
|
|
370
|
+
|
|
371
|
+
<span class="ruby-ivar">@info</span> = <span class="ruby-string">'.'</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">f</span>[<span class="ruby-value">7</span>] <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> {}
|
|
407
372
|
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@info</span>
|
|
408
373
|
<span class="ruby-identifier">info_vec</span> = <span class="ruby-identifier">f</span>[<span class="ruby-value">7</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">";"</span>)
|
|
409
374
|
<span class="ruby-identifier">info_vec</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
|
|
410
375
|
<span class="ruby-identifier">keyval</span> = <span class="ruby-identifier">x</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">"="</span>, <span class="ruby-value">-1</span>)
|
|
411
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">keyval</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span> <span class="ruby-comment"># If it
|
|
376
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">keyval</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">2</span> <span class="ruby-comment"># If it's key=value</span>
|
|
412
377
|
<span class="ruby-ivar">@info</span>[<span class="ruby-identifier">keyval</span>[<span class="ruby-value">0</span>]] = <span class="ruby-identifier">keyval</span>[<span class="ruby-value">1</span>]
|
|
413
|
-
<span class="ruby-keyword">else</span> <span class="ruby-comment"># Otherwise, it
|
|
378
|
+
<span class="ruby-keyword">else</span> <span class="ruby-comment"># Otherwise, it's just a flag</span>
|
|
414
379
|
<span class="ruby-ivar">@info</span>[<span class="ruby-identifier">x</span>] = <span class="ruby-keyword">nil</span>
|
|
415
380
|
<span class="ruby-keyword">end</span>
|
|
416
381
|
<span class="ruby-keyword">end</span>
|
|
417
382
|
<span class="ruby-keyword">end</span>
|
|
418
|
-
|
|
383
|
+
|
|
419
384
|
<span class="ruby-ivar">@samples</span> = {}
|
|
420
385
|
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">8</span> <span class="ruby-comment"># Has just upto info</span>
|
|
421
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-string">"Can
|
|
386
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-string">"Can't have format with no samples"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">9</span>
|
|
422
387
|
|
|
423
388
|
<span class="ruby-ivar">@format</span> = <span class="ruby-identifier">f</span>[<span class="ruby-value">8</span>]
|
|
424
|
-
|
|
389
|
+
|
|
425
390
|
<span class="ruby-identifier">sample_keys</span> = <span class="ruby-ivar">@format</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">":"</span>)
|
|
426
|
-
|
|
391
|
+
|
|
427
392
|
<span class="ruby-identifier">num_samples</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">9</span> <span class="ruby-comment"># How many fields are past the format</span>
|
|
428
|
-
|
|
393
|
+
|
|
429
394
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">sample_names</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-comment"># Make the sample names just ["1", "2", ... , "num_samples}"</span>
|
|
430
395
|
<span class="ruby-identifier">sample_names</span> = (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">num_samples</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_s</span>}
|
|
431
396
|
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">sample_names</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">num_samples</span>
|
|
432
397
|
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Unexpected number of samples (#{num_samples}) based on the provided sample names (#{sample_names.inspect})"</span>
|
|
433
398
|
<span class="ruby-keyword">end</span>
|
|
434
|
-
|
|
399
|
+
|
|
435
400
|
<span class="ruby-identifier">sample_names</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sample_name</span>, <span class="ruby-identifier">sample_index</span><span class="ruby-operator">|</span>
|
|
436
401
|
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">sample_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">9</span> <span class="ruby-comment"># index into columns (f)</span>
|
|
437
402
|
<span class="ruby-identifier">sample_values</span> = <span class="ruby-identifier">f</span>[<span class="ruby-identifier">i</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">":"</span>)
|
|
@@ -442,26 +407,25 @@ setting the attributes</p>
|
|
|
442
407
|
|
|
443
408
|
<span class="ruby-keyword">return</span> <span class="ruby-keyword">true</span>;
|
|
444
409
|
<span class="ruby-keyword">end</span></pre>
|
|
445
|
-
</div
|
|
410
|
+
</div>
|
|
446
411
|
|
|
447
412
|
</div>
|
|
448
413
|
|
|
449
414
|
|
|
450
415
|
|
|
451
416
|
|
|
452
|
-
</div
|
|
417
|
+
</div>
|
|
453
418
|
|
|
454
419
|
|
|
455
|
-
</section
|
|
420
|
+
</section>
|
|
456
421
|
|
|
457
|
-
</section
|
|
458
|
-
|
|
459
|
-
</div><!-- documentation -->
|
|
422
|
+
</section>
|
|
423
|
+
</main>
|
|
460
424
|
|
|
461
425
|
|
|
462
|
-
<footer id="validator-badges">
|
|
463
|
-
<p><a href="http://validator.w3.org/check/referer">
|
|
464
|
-
<p>Generated by <a href="
|
|
465
|
-
<p>
|
|
426
|
+
<footer id="validator-badges" role="contentinfo">
|
|
427
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
428
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
|
|
429
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
466
430
|
</footer>
|
|
467
431
|
|