bio-ucsc-api 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,25 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::Description" do
3
+
4
+ describe "#find" do
5
+ context "given range *(0..9)" do
6
+ it "returens an array of results" do
7
+ Bio::Ucsc::Hg19::DBConnection.default
8
+ Bio::Ucsc::Hg19::DBConnection.connect
9
+ Bio::Ucsc::Hg19::Description.find([*(0..9)]).should have(10).items
10
+ end
11
+ end
12
+ end
13
+
14
+ describe ".gbCndaInfo.acc" do
15
+ context "given id==1" do
16
+ it 'returens "AB004856"' do
17
+ Bio::Ucsc::Hg19::DBConnection.default
18
+ Bio::Ucsc::Hg19::DBConnection.connect
19
+ Bio::Ucsc::Hg19::Description.find(1).gbCdnaInfo.acc.should == "AB004856"
20
+ end
21
+ end
22
+ end
23
+
24
+
25
+ end
@@ -0,0 +1,25 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::GbCdnaInfo" do
3
+
4
+ describe "#find" do
5
+ context "given range *(1..9)" do
6
+ it "returens an array of results" do
7
+ Bio::Ucsc::Hg19::DBConnection.default
8
+ Bio::Ucsc::Hg19::DBConnection.connect
9
+ Bio::Ucsc::Hg19::GbCdnaInfo.find([*(1..9)]).should have(9).items
10
+ end
11
+ end
12
+ end
13
+
14
+ describe ".description.name" do
15
+ context "given id==1" do
16
+ it 'returens 1' do
17
+ Bio::Ucsc::Hg19::DBConnection.default
18
+ Bio::Ucsc::Hg19::DBConnection.connect
19
+ r = Bio::Ucsc::Hg19::GbCdnaInfo.find(1, :include => :description)
20
+ r.description.id.should == 1
21
+ end
22
+ end
23
+ end
24
+
25
+ end
@@ -0,0 +1,14 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::KgXref" do
3
+
4
+ describe "#find_by_geneSymbol" do
5
+ context 'given "TP53"' do
6
+ it "returens an array of results" do
7
+ Bio::Ucsc::Hg19::DBConnection.default
8
+ Bio::Ucsc::Hg19::DBConnection.connect
9
+ Bio::Ucsc::Hg19::KgXref.find_all_by_geneSymbol("TP53").should have(13).item
10
+ end
11
+ end
12
+ end
13
+
14
+ end
@@ -0,0 +1,137 @@
1
+ require 'bio-ucsc'
2
+
3
+ describe "Bio::Ucsc::Hg19::Reference" do
4
+
5
+ describe ".load" do
6
+ context 'given "../samples/hg19.2bit"' do
7
+ it "returns true" do
8
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
9
+ end
10
+ end
11
+ end
12
+
13
+ describe ".header.signarue" do
14
+ context 'given "../samples/hg19.2bit"' do
15
+ it "returns 0x1A412743" do
16
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
17
+ Bio::Ucsc::Hg19::Reference.header.signature.should == 0x1A412743
18
+ end
19
+ end
20
+ end
21
+
22
+ describe ".header.version" do
23
+ context 'given "../samples/hg19.2bit"' do
24
+ it "returns 0" do
25
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
26
+ Bio::Ucsc::Hg19::Reference.header.version.should == 0
27
+ end
28
+ end
29
+ end
30
+
31
+ describe ".header.sequence_count" do
32
+ context 'given "../samples/hg19.2bit"' do
33
+ it "returns 0x5d" do
34
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
35
+ Bio::Ucsc::Hg19::Reference.header.sequence_count.should == 0x5d
36
+ end
37
+ end
38
+ end
39
+
40
+ describe '.offsets["chr1"]' do
41
+ context 'given "../samples/hg19.2bit"' do
42
+ it "returns 0x0687" do
43
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
44
+ Bio::Ucsc::Hg19::Reference.offsets["chr1"].should == 0x0687
45
+ end
46
+ end
47
+ end
48
+
49
+ describe ".records" do
50
+ context 'given "chr1"' do
51
+ it 'returns (TwoBitRecord.reserved == 0)' do
52
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
53
+ Bio::Ucsc::Hg19::Reference.records("chr1").reserved == 0
54
+ end
55
+ end
56
+ end
57
+
58
+ describe ".records" do
59
+ context 'given "chr1"' do
60
+ it 'returns (TwoBitRecord.dna_size == 249_250_621)' do
61
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
62
+ Bio::Ucsc::Hg19::Reference.records("chr1").dna_size.should == 249_250_621
63
+ end
64
+ end
65
+ end
66
+
67
+ describe ".byte_to_nucleotides" do
68
+ context 'given 0b00011011' do
69
+ it 'returns "TCAG"' do
70
+ r = Bio::Ucsc::Hg19::Reference.byte_to_nucleotides(0b00011011)
71
+ r.should == "TCAG"
72
+ end
73
+ end
74
+ end
75
+
76
+ describe ".bytes_to_nucleotides" do
77
+ context 'given [0b00011011, 0b11100100]' do
78
+ it 'returns "TCAGGACT"' do
79
+ ary = [0b00011011, 0b11100100]
80
+ r = Bio::Ucsc::Hg19::Reference.bytes_to_nucleotides(ary)
81
+ r.should == "TCAGGACT"
82
+ end
83
+ end
84
+ end
85
+
86
+ describe ".find_by_interval_raw" do
87
+ context "given range chr1:1,000,000-1,000,030" do
88
+ it 'returens "TGGGCACAGCCTCACCCAGGAAAGCAGCTGG"' do
89
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
90
+ itv = Bio::GenomicInterval.parse("chr1:1,000,000-1,000,030")
91
+ r = Bio::Ucsc::Hg19::Reference.find_by_interval_raw(itv)
92
+ r.should == "TGGGCACAGCCTCACCCAGGAAAGCAGCTGG"
93
+ end
94
+ end
95
+
96
+ context "given range chr2:1,123,456-1,123,499" do
97
+ it 'returens "GTACTTAGAACACTATTGATTTCTGTACGTTGATTTTGTATTCT"' do
98
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
99
+ itv = Bio::GenomicInterval.parse("chr2:1,123,456-1,123,499")
100
+ r = Bio::Ucsc::Hg19::Reference.find_by_interval_raw(itv)
101
+ r.should == "GTACTTAGAACACTATTGATTTCTGTACGTTGATTTTGTATTCT"
102
+ end
103
+ end
104
+
105
+ context "given range chr2:1,123,456-1,123,456" do
106
+ it 'returens "G"' do
107
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
108
+ itv = Bio::GenomicInterval.parse("chr2:1,123,456-1,123,456")
109
+ r = Bio::Ucsc::Hg19::Reference.find_by_interval_raw(itv)
110
+ r.should == "G"
111
+ end
112
+ end
113
+ end
114
+
115
+ describe ".find_by_interval" do
116
+ context "given range chr1:9,980-10,020" do
117
+ it 'returns "NNNNNNNNNNNNNNNNNNNNNTAACCCTAACCCTAACCCTA"' do
118
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
119
+ itv = Bio::GenomicInterval.parse("chr1:9,980-10,020")
120
+ r = Bio::Ucsc::Hg19::Reference.find_by_interval(itv)
121
+ r.should == "NNNNNNNNNNNNNNNNNNNNNTAACCCTAACCCTAACCCTA"
122
+ end
123
+ end
124
+
125
+ # N-block => chr1:267,720-317,719
126
+ context "given range chr1:267,690-267,735" do
127
+ it 'returns "GGGACTACAGGCGCCCGCATCCAGCTGGATNNNNNNNNNNNNNNNN' do
128
+ Bio::Ucsc::Hg19::Reference.load("samples/hg19.2bit")
129
+ itv = Bio::GenomicInterval.parse("chr1:267,690-267,735")
130
+ r = Bio::Ucsc::Hg19::Reference.find_by_interval(itv)
131
+ r.should == "GGGACTACAGGCGCCCGCATCCAGCTGGATNNNNNNNNNNNNNNNN"
132
+ end
133
+ end
134
+ end
135
+ end
136
+
137
+
@@ -0,0 +1,15 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::RefSeqSummary" do
3
+
4
+ describe "#find_all_by_mrnaAcc" do
5
+ context 'given "NR_036941"' do
6
+ it "returens an array of results" do
7
+ Bio::Ucsc::Hg19::DBConnection.default
8
+ Bio::Ucsc::Hg19::DBConnection.connect
9
+ r = Bio::Ucsc::Hg19::RefSeqSummary.find_all_by_mrnaAcc("NR_036941")
10
+ r.should have(1).item
11
+ end
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::TRNAs" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-10,000,000" do
6
+ it "returens an array of results" do
7
+ Bio::Ucsc::Hg19::DBConnection.default
8
+ Bio::Ucsc::Hg19::DBConnection.connect
9
+ i = Bio::GenomicInterval.parse("chr1:1-10,000,000")
10
+ Bio::Ucsc::Hg19::TRNAs.find_by_interval(i).should have(1).items
11
+ end
12
+
13
+ it "returens an array of results with column accessors" do
14
+ Bio::Ucsc::Hg19::DBConnection.default
15
+ Bio::Ucsc::Hg19::DBConnection.connect
16
+ i = Bio::GenomicInterval.parse("chr1:1-10,000,000")
17
+ r = Bio::Ucsc::Hg19::TRNAs.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-ucsc-api
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 1
9
- version: 0.0.1
4
+ prerelease:
5
+ version: 0.0.3
10
6
  platform: ruby
11
7
  authors:
12
8
  - MISHIMA, Hiroyuki
@@ -16,8 +12,7 @@ autorequire:
16
12
  bindir: bin
17
13
  cert_chain: []
18
14
 
19
- date: 2011-04-22 00:00:00 +09:00
20
- default_executable:
15
+ date: 2011-04-25 00:00:00 Z
21
16
  dependencies:
22
17
  - !ruby/object:Gem::Dependency
23
18
  name: activerecord
@@ -26,10 +21,6 @@ dependencies:
26
21
  requirements:
27
22
  - - ">="
28
23
  - !ruby/object:Gem::Version
29
- segments:
30
- - 3
31
- - 0
32
- - 7
33
24
  version: 3.0.7
34
25
  type: :runtime
35
26
  prerelease: false
@@ -41,10 +32,6 @@ dependencies:
41
32
  requirements:
42
33
  - - ">="
43
34
  - !ruby/object:Gem::Version
44
- segments:
45
- - 2
46
- - 8
47
- - 1
48
35
  version: 2.8.1
49
36
  type: :runtime
50
37
  prerelease: false
@@ -56,10 +43,6 @@ dependencies:
56
43
  requirements:
57
44
  - - ">="
58
45
  - !ruby/object:Gem::Version
59
- segments:
60
- - 0
61
- - 1
62
- - 2
63
46
  version: 0.1.2
64
47
  type: :runtime
65
48
  prerelease: false
@@ -71,10 +54,6 @@ dependencies:
71
54
  requirements:
72
55
  - - ~>
73
56
  - !ruby/object:Gem::Version
74
- segments:
75
- - 2
76
- - 5
77
- - 0
78
57
  version: 2.5.0
79
58
  type: :development
80
59
  prerelease: false
@@ -86,10 +65,6 @@ dependencies:
86
65
  requirements:
87
66
  - - ~>
88
67
  - !ruby/object:Gem::Version
89
- segments:
90
- - 1
91
- - 0
92
- - 0
93
68
  version: 1.0.0
94
69
  type: :development
95
70
  prerelease: false
@@ -101,10 +76,6 @@ dependencies:
101
76
  requirements:
102
77
  - - ~>
103
78
  - !ruby/object:Gem::Version
104
- segments:
105
- - 1
106
- - 5
107
- - 2
108
79
  version: 1.5.2
109
80
  type: :development
110
81
  prerelease: false
@@ -116,8 +87,6 @@ dependencies:
116
87
  requirements:
117
88
  - - ">="
118
89
  - !ruby/object:Gem::Version
119
- segments:
120
- - 0
121
90
  version: "0"
122
91
  type: :development
123
92
  prerelease: false
@@ -129,10 +98,6 @@ dependencies:
129
98
  requirements:
130
99
  - - ">="
131
100
  - !ruby/object:Gem::Version
132
- segments:
133
- - 1
134
- - 4
135
- - 1
136
101
  version: 1.4.1
137
102
  type: :development
138
103
  prerelease: false
@@ -144,10 +109,6 @@ dependencies:
144
109
  requirements:
145
110
  - - ">="
146
111
  - !ruby/object:Gem::Version
147
- segments:
148
- - 3
149
- - 0
150
- - 0
151
112
  version: 3.0.0
152
113
  type: :runtime
153
114
  prerelease: false
@@ -159,10 +120,6 @@ dependencies:
159
120
  requirements:
160
121
  - - ">="
161
122
  - !ruby/object:Gem::Version
162
- segments:
163
- - 3
164
- - 0
165
- - 0
166
123
  version: 3.0.0
167
124
  type: :runtime
168
125
  prerelease: false
@@ -174,11 +131,7 @@ dependencies:
174
131
  requirements:
175
132
  - - ">="
176
133
  - !ruby/object:Gem::Version
177
- segments:
178
- - 0
179
- - 1
180
- - 1
181
- version: 0.1.1
134
+ version: 0.1.2
182
135
  type: :runtime
183
136
  prerelease: false
184
137
  version_requirements: *id011
@@ -211,6 +164,7 @@ files:
211
164
  - lib/bio-ucsc/hg18/cnpsharp2.rb
212
165
  - lib/bio-ucsc/hg18/db_connection.rb
213
166
  - lib/bio-ucsc/hg18/dgv.rb
167
+ - lib/bio-ucsc/hg18/reference.rb
214
168
  - lib/bio-ucsc/hg18/refgene.rb
215
169
  - lib/bio-ucsc/hg18/rmsk.rb
216
170
  - lib/bio-ucsc/hg18/tables.rb
@@ -219,8 +173,10 @@ files:
219
173
  - lib/bio-ucsc/hg19/ccdsgene.rb
220
174
  - lib/bio-ucsc/hg19/cytoband.rb
221
175
  - lib/bio-ucsc/hg19/db_connection.rb
176
+ - lib/bio-ucsc/hg19/description.rb
222
177
  - lib/bio-ucsc/hg19/dgv.rb
223
178
  - lib/bio-ucsc/hg19/ensgene.rb
179
+ - lib/bio-ucsc/hg19/gbcdnainfo.rb
224
180
  - lib/bio-ucsc/hg19/gwascatalog.rb
225
181
  - lib/bio-ucsc/hg19/hapmapalleleschimp.rb
226
182
  - lib/bio-ucsc/hg19/hapmapallelesmacaque.rb
@@ -235,11 +191,14 @@ files:
235
191
  - lib/bio-ucsc/hg19/hapmapsnpsmkk.rb
236
192
  - lib/bio-ucsc/hg19/hapmapsnpstsi.rb
237
193
  - lib/bio-ucsc/hg19/hapmapsnpsyri.rb
194
+ - lib/bio-ucsc/hg19/kgxref.rb
238
195
  - lib/bio-ucsc/hg19/knowngene.rb
239
196
  - lib/bio-ucsc/hg19/omimgene.rb
240
197
  - lib/bio-ucsc/hg19/phastconselements46wayprimates.rb
241
198
  - lib/bio-ucsc/hg19/phylop46wayprimates.rb
199
+ - lib/bio-ucsc/hg19/reference.rb
242
200
  - lib/bio-ucsc/hg19/refgene.rb
201
+ - lib/bio-ucsc/hg19/refseqsummary.rb
243
202
  - lib/bio-ucsc/hg19/rmsk.rb
244
203
  - lib/bio-ucsc/hg19/snp131.rb
245
204
  - lib/bio-ucsc/hg19/snp132.rb
@@ -247,9 +206,12 @@ files:
247
206
  - lib/bio-ucsc/hg19/snp132common.rb
248
207
  - lib/bio-ucsc/hg19/snp132flagged.rb
249
208
  - lib/bio-ucsc/hg19/snp132mult.rb
209
+ - lib/bio-ucsc/hg19/trnas.rb
250
210
  - lib/bio-ucsc/hg19/wgrna.rb
251
211
  - lib/bio-ucsc/ucsc_bin.rb
212
+ - samples/hg19-2bit-retrieve.rb
252
213
  - samples/hg19-sample.rb
214
+ - samples/symbol2summary.rb
253
215
  - spec/hg18/cnpiafrate2_spec.rb
254
216
  - spec/hg18/cnplocke_spec.rb
255
217
  - spec/hg18/cnpredon_spec.rb
@@ -257,13 +219,16 @@ files:
257
219
  - spec/hg18/cnpsharp2_spec.rb
258
220
  - spec/hg18/db_connection_spec.rb
259
221
  - spec/hg18/dgv_spec.rb
222
+ - spec/hg18/reference_spec.rb
260
223
  - spec/hg18/refgene_spec.rb
261
224
  - spec/hg18/rmsk_spec.rb
262
225
  - spec/hg19/ccdsgene_spec.rb
263
226
  - spec/hg19/cytoband_spec.rb
264
227
  - spec/hg19/db_connection_spec.rb
228
+ - spec/hg19/description_spec.rb
265
229
  - spec/hg19/dgv_spec.rb
266
230
  - spec/hg19/ensgene_spec.rb
231
+ - spec/hg19/gbcdnainfo_spec.rb
267
232
  - spec/hg19/gwascatalog_spec.rb
268
233
  - spec/hg19/hapmapalleleschimp_spec.rb
269
234
  - spec/hg19/hapmapallelesmacaque_spec.rb
@@ -278,20 +243,23 @@ files:
278
243
  - spec/hg19/hapmapsnpsmkk_spec.rb
279
244
  - spec/hg19/hapmapsnpstsi_spec.rb
280
245
  - spec/hg19/hapmapsnpsyri_spec.rb
246
+ - spec/hg19/kgxref_spec.rb
281
247
  - spec/hg19/knowngene_spec.rb
282
248
  - spec/hg19/omimGene_spec.rb
283
249
  - spec/hg19/phastconselements46wayprimates_spec.rb
284
250
  - spec/hg19/phyloP46wayPrimates_spec.rb
251
+ - spec/hg19/reference_spec.rb
285
252
  - spec/hg19/refgene_spec.rb
253
+ - spec/hg19/refseqsummary_spec.rb
286
254
  - spec/hg19/rmsk_spec.rb
287
255
  - spec/hg19/snp132Flagged_spec.rb
288
256
  - spec/hg19/snp132_spec.rb
289
257
  - spec/hg19/snp132codingdbsnp_spec.rb
290
258
  - spec/hg19/snp132common_spec.rb
291
259
  - spec/hg19/snp132mult_spec.rb
260
+ - spec/hg19/trnas_spec.rb
292
261
  - spec/hg19/wgrna_spec.rb
293
262
  - spec/spec_helper.rb
294
- has_rdoc: true
295
263
  homepage: http://github.com/misshie/bioruby-ucsc-api
296
264
  licenses:
297
265
  - Ruby (Ruby's/GPLv2 dual)
@@ -305,7 +273,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
305
273
  requirements:
306
274
  - - ">="
307
275
  - !ruby/object:Gem::Version
308
- hash: -300095872068821190
276
+ hash: 2324911911426027047
309
277
  segments:
310
278
  - 0
311
279
  version: "0"
@@ -314,13 +282,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
314
282
  requirements:
315
283
  - - ">="
316
284
  - !ruby/object:Gem::Version
317
- segments:
318
- - 0
319
285
  version: "0"
320
286
  requirements: []
321
287
 
322
288
  rubyforge_project:
323
- rubygems_version: 1.3.7
289
+ rubygems_version: 1.7.2
324
290
  signing_key:
325
291
  specification_version: 3
326
292
  summary: "A Bioruby plugin: an API for UCSC Genome Browser (experimental)"
@@ -332,13 +298,16 @@ test_files:
332
298
  - spec/hg18/cnpsharp2_spec.rb
333
299
  - spec/hg18/db_connection_spec.rb
334
300
  - spec/hg18/dgv_spec.rb
301
+ - spec/hg18/reference_spec.rb
335
302
  - spec/hg18/refgene_spec.rb
336
303
  - spec/hg18/rmsk_spec.rb
337
304
  - spec/hg19/ccdsgene_spec.rb
338
305
  - spec/hg19/cytoband_spec.rb
339
306
  - spec/hg19/db_connection_spec.rb
307
+ - spec/hg19/description_spec.rb
340
308
  - spec/hg19/dgv_spec.rb
341
309
  - spec/hg19/ensgene_spec.rb
310
+ - spec/hg19/gbcdnainfo_spec.rb
342
311
  - spec/hg19/gwascatalog_spec.rb
343
312
  - spec/hg19/hapmapalleleschimp_spec.rb
344
313
  - spec/hg19/hapmapallelesmacaque_spec.rb
@@ -353,16 +322,20 @@ test_files:
353
322
  - spec/hg19/hapmapsnpsmkk_spec.rb
354
323
  - spec/hg19/hapmapsnpstsi_spec.rb
355
324
  - spec/hg19/hapmapsnpsyri_spec.rb
325
+ - spec/hg19/kgxref_spec.rb
356
326
  - spec/hg19/knowngene_spec.rb
357
327
  - spec/hg19/omimGene_spec.rb
358
328
  - spec/hg19/phastconselements46wayprimates_spec.rb
359
329
  - spec/hg19/phyloP46wayPrimates_spec.rb
330
+ - spec/hg19/reference_spec.rb
360
331
  - spec/hg19/refgene_spec.rb
332
+ - spec/hg19/refseqsummary_spec.rb
361
333
  - spec/hg19/rmsk_spec.rb
362
334
  - spec/hg19/snp132Flagged_spec.rb
363
335
  - spec/hg19/snp132_spec.rb
364
336
  - spec/hg19/snp132codingdbsnp_spec.rb
365
337
  - spec/hg19/snp132common_spec.rb
366
338
  - spec/hg19/snp132mult_spec.rb
339
+ - spec/hg19/trnas_spec.rb
367
340
  - spec/hg19/wgrna_spec.rb
368
341
  - spec/spec_helper.rb