bio-ucsc-api 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/.document +5 -0
  2. data/.rspec +2 -0
  3. data/COPYING +58 -0
  4. data/COPYING.ja +51 -0
  5. data/Gemfile +19 -0
  6. data/Gemfile.lock +49 -0
  7. data/README.rdoc +57 -0
  8. data/Rakefile +72 -0
  9. data/VERSION +1 -0
  10. data/bio-ucsc-api.gemspec +212 -0
  11. data/lib/bio-ucsc.rb +20 -0
  12. data/lib/bio-ucsc/hg18.rb +27 -0
  13. data/lib/bio-ucsc/hg18/activerecord.rb +166 -0
  14. data/lib/bio-ucsc/hg18/cnpiafrate2.rb +31 -0
  15. data/lib/bio-ucsc/hg18/cnplocke.rb +31 -0
  16. data/lib/bio-ucsc/hg18/cnpredon.rb +32 -0
  17. data/lib/bio-ucsc/hg18/cnpsebat2.rb +35 -0
  18. data/lib/bio-ucsc/hg18/cnpsharp2.rb +32 -0
  19. data/lib/bio-ucsc/hg18/db_connection.rb +61 -0
  20. data/lib/bio-ucsc/hg18/dgv.rb +27 -0
  21. data/lib/bio-ucsc/hg18/refgene.rb +27 -0
  22. data/lib/bio-ucsc/hg18/rmsk.rb +51 -0
  23. data/lib/bio-ucsc/hg18/tables.rb +142 -0
  24. data/lib/bio-ucsc/hg19.rb +54 -0
  25. data/lib/bio-ucsc/hg19/activerecord.rb +217 -0
  26. data/lib/bio-ucsc/hg19/ccdsgene.rb +33 -0
  27. data/lib/bio-ucsc/hg19/cytoband.rb +33 -0
  28. data/lib/bio-ucsc/hg19/db_connection.rb +61 -0
  29. data/lib/bio-ucsc/hg19/dgv.rb +27 -0
  30. data/lib/bio-ucsc/hg19/ensgene.rb +21 -0
  31. data/lib/bio-ucsc/hg19/gwascatalog.rb +26 -0
  32. data/lib/bio-ucsc/hg19/hapmapalleleschimp.rb +35 -0
  33. data/lib/bio-ucsc/hg19/hapmapallelesmacaque.rb +35 -0
  34. data/lib/bio-ucsc/hg19/hapmapsnpsasw.rb +33 -0
  35. data/lib/bio-ucsc/hg19/hapmapsnpsceu.rb +33 -0
  36. data/lib/bio-ucsc/hg19/hapmapsnpschb.rb +33 -0
  37. data/lib/bio-ucsc/hg19/hapmapsnpschd.rb +33 -0
  38. data/lib/bio-ucsc/hg19/hapmapsnpsgih.rb +34 -0
  39. data/lib/bio-ucsc/hg19/hapmapsnpsjpt.rb +34 -0
  40. data/lib/bio-ucsc/hg19/hapmapsnpslwk.rb +35 -0
  41. data/lib/bio-ucsc/hg19/hapmapsnpsmex.rb +35 -0
  42. data/lib/bio-ucsc/hg19/hapmapsnpsmkk.rb +35 -0
  43. data/lib/bio-ucsc/hg19/hapmapsnpstsi.rb +35 -0
  44. data/lib/bio-ucsc/hg19/hapmapsnpsyri.rb +35 -0
  45. data/lib/bio-ucsc/hg19/knowngene.rb +34 -0
  46. data/lib/bio-ucsc/hg19/omimgene.rb +25 -0
  47. data/lib/bio-ucsc/hg19/phastconselements46wayprimates.rb +27 -0
  48. data/lib/bio-ucsc/hg19/phylop46wayprimates.rb +27 -0
  49. data/lib/bio-ucsc/hg19/refgene.rb +27 -0
  50. data/lib/bio-ucsc/hg19/rmsk.rb +32 -0
  51. data/lib/bio-ucsc/hg19/snp131.rb +30 -0
  52. data/lib/bio-ucsc/hg19/snp132.rb +31 -0
  53. data/lib/bio-ucsc/hg19/snp132codingdbsnp.rb +29 -0
  54. data/lib/bio-ucsc/hg19/snp132common.rb +32 -0
  55. data/lib/bio-ucsc/hg19/snp132flagged.rb +31 -0
  56. data/lib/bio-ucsc/hg19/snp132mult.rb +32 -0
  57. data/lib/bio-ucsc/hg19/wgrna.rb +29 -0
  58. data/lib/bio-ucsc/ucsc_bin.rb +148 -0
  59. data/samples/hg19-sample.rb +66 -0
  60. data/spec/hg18/cnpiafrate2_spec.rb +23 -0
  61. data/spec/hg18/cnplocke_spec.rb +23 -0
  62. data/spec/hg18/cnpredon_spec.rb +23 -0
  63. data/spec/hg18/cnpsebat2_spec.rb +23 -0
  64. data/spec/hg18/cnpsharp2_spec.rb +23 -0
  65. data/spec/hg18/db_connection_spec.rb +36 -0
  66. data/spec/hg18/dgv_spec.rb +23 -0
  67. data/spec/hg18/refgene_spec.rb +23 -0
  68. data/spec/hg18/rmsk_spec.rb +33 -0
  69. data/spec/hg19/ccdsgene_spec.rb +23 -0
  70. data/spec/hg19/cytoband_spec.rb +23 -0
  71. data/spec/hg19/db_connection_spec.rb +37 -0
  72. data/spec/hg19/dgv_spec.rb +23 -0
  73. data/spec/hg19/ensgene_spec.rb +23 -0
  74. data/spec/hg19/gwascatalog_spec.rb +23 -0
  75. data/spec/hg19/hapmapalleleschimp_spec.rb +23 -0
  76. data/spec/hg19/hapmapallelesmacaque_spec.rb +23 -0
  77. data/spec/hg19/hapmapsnpsasw_spec.rb +23 -0
  78. data/spec/hg19/hapmapsnpsceu_spec.rb +23 -0
  79. data/spec/hg19/hapmapsnpschb_spec.rb +23 -0
  80. data/spec/hg19/hapmapsnpschd_spec.rb +23 -0
  81. data/spec/hg19/hapmapsnpsgih_spec.rb +23 -0
  82. data/spec/hg19/hapmapsnpsjpt_spec.rb +23 -0
  83. data/spec/hg19/hapmapsnpslwk_spec.rb +23 -0
  84. data/spec/hg19/hapmapsnpsmex_spec.rb +23 -0
  85. data/spec/hg19/hapmapsnpsmkk_spec.rb +23 -0
  86. data/spec/hg19/hapmapsnpstsi_spec.rb +23 -0
  87. data/spec/hg19/hapmapsnpsyri_spec.rb +23 -0
  88. data/spec/hg19/knowngene_spec.rb +23 -0
  89. data/spec/hg19/omimGene_spec.rb +23 -0
  90. data/spec/hg19/phastconselements46wayprimates_spec.rb +23 -0
  91. data/spec/hg19/phyloP46wayPrimates_spec.rb +23 -0
  92. data/spec/hg19/refgene_spec.rb +23 -0
  93. data/spec/hg19/rmsk_spec.rb +23 -0
  94. data/spec/hg19/snp132Flagged_spec.rb +24 -0
  95. data/spec/hg19/snp132_spec.rb +23 -0
  96. data/spec/hg19/snp132codingdbsnp_spec.rb +23 -0
  97. data/spec/hg19/snp132common_spec.rb +24 -0
  98. data/spec/hg19/snp132mult_spec.rb +23 -0
  99. data/spec/hg19/wgrna_spec.rb +23 -0
  100. data/spec/spec_helper.rb +12 -0
  101. metadata +368 -0
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::HapMapSnpsCHD" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-600,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-600,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsCHD.find_by_interval(i).should have(5).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-600,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsCHD.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::HapMapSnpsGIH" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-600,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-600,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsGIH.find_by_interval(i).should have(2).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-600,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsGIH.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::HapMapSnpsJPT" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-600,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-600,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsJPT.find_by_interval(i).should have(44).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-600,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsJPT.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::HapMapSnpsLWK" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-600,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-600,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsLWK.find_by_interval(i).should have(3).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-600,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsLWK.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::HapMapSnpsMEX" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-600,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-600,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsMEX.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-600,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsMEX.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::HapMapSnpsMKK" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-600,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-600,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsMKK.find_by_interval(i).should have(3).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-600,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsMKK.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::HapMapSnpsTSI" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-600,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-600,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsTSI.find_by_interval(i).should have(2).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-600,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsTSI.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::HapMapSnpsYRI" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-600,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-600,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsYRI.find_by_interval(i).should have(45).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-600,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsYRI.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::KnownGene" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-20000" 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-20000")
10
+ Bio::Ucsc::Hg19::KnownGene.find_by_interval(i).should have(24).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-20000")
17
+ r = Bio::Ucsc::Hg19::KnownGene.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::OmimGene" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-1,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-1,000,000")
10
+ Bio::Ucsc::Hg19::OmimGene.find_by_interval(i).should have(4).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-1,000,000")
17
+ r = Bio::Ucsc::Hg19::OmimGene.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::PhastConsElements46wayPrimates" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-80,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-80,000")
10
+ Bio::Ucsc::Hg19::PhastConsElements46wayPrimates.find_by_interval(i).should have(4).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-80,000")
17
+ r = Bio::Ucsc::Hg19::PhastConsElements46wayPrimates.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::PhyloP46wayPrimates" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-50,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-50,000")
10
+ Bio::Ucsc::Hg19::PhyloP46wayPrimates.find_by_interval(i).should have(39).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-50,000")
17
+ r = Bio::Ucsc::Hg19::PhyloP46wayPrimates.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::RefGene" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-100,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-100,000")
10
+ Bio::Ucsc::Hg19::RefGene.find_by_interval(i).should have(4).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-100,000")
17
+ r = Bio::Ucsc::Hg19::RefGene.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::Rmsk" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-100,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-100,000")
10
+ Bio::Ucsc::Hg19::Rmsk.find_by_interval(i).should have(146).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-100,000")
17
+ r = Bio::Ucsc::Hg19::Rmsk.find_by_interval(i)
18
+ r[0].genoName.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,24 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::Snp132Flagged" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-2,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-2,000,000")
10
+ Bio::Ucsc::Hg19::Snp132Flagged.find_by_interval(i).should have(3).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-2,000,000")
17
+ r = Bio::Ucsc::Hg19::Snp132Flagged.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
24
+
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::Snp132" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-12,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-12,000")
10
+ Bio::Ucsc::Hg19::Snp132.find_by_interval(i).should have(67).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-12,000")
17
+ r = Bio::Ucsc::Hg19::Snp132.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::Snp132CodingDbSnp" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-50,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-50,000")
10
+ Bio::Ucsc::Hg19::Snp132CodingDbSnp.find_by_interval(i).should have(23).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-50,000")
17
+ r = Bio::Ucsc::Hg19::Snp132CodingDbSnp.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,24 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::Snp132Common" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-20000" 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-20000")
10
+ Bio::Ucsc::Hg19::Snp132Common.find_by_interval(i).should have(4).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-20000")
17
+ r = Bio::Ucsc::Hg19::Snp132Common.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
24
+