bio-ucsc-api 0.0.1

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.
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::Hg18::CnpSebat2" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-20,000,000" do
6
+ it "returns an array of results" do
7
+ Bio::Ucsc::Hg18::DBConnection.default
8
+ Bio::Ucsc::Hg18::DBConnection.connect
9
+ i = Bio::GenomicInterval.parse("chr1:1-20,000,000")
10
+ Bio::Ucsc::Hg18::CnpSebat2.find_by_interval(i).should have(1).items
11
+ end
12
+
13
+ it "returns an array of results with column accessors" do
14
+ Bio::Ucsc::Hg18::DBConnection.default
15
+ Bio::Ucsc::Hg18::DBConnection.connect
16
+ i = Bio::GenomicInterval.parse("chr1:1-20,000,000")
17
+ r = Bio::Ucsc::Hg18::CnpSebat2.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::Hg18::CnpSharp2" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-2,000,000" do
6
+ it "returns an array of results" do
7
+ Bio::Ucsc::Hg18::DBConnection.default
8
+ Bio::Ucsc::Hg18::DBConnection.connect
9
+ i = Bio::GenomicInterval.parse("chr1:1-2,000,000")
10
+ Bio::Ucsc::Hg18::CnpSharp2.find_by_interval(i).should have(1).items
11
+ end
12
+
13
+ it "returns an array of results with column accessors" do
14
+ Bio::Ucsc::Hg18::DBConnection.default
15
+ Bio::Ucsc::Hg18::DBConnection.connect
16
+ i = Bio::GenomicInterval.parse("chr1:1-2,000,000")
17
+ r = Bio::Ucsc::Hg18::CnpSharp2.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,36 @@
1
+ #
2
+ # = /spec/db_connection_spec.rb - Rspec specification for Ucsc::Hg18
3
+ #
4
+ # Copyright:: Cioyrught (C) 2011
5
+ # MISHIMA, Hiroyuki <missy at be.to / hmishima at nagasaki-u.ac.jp>
6
+ # License:: Ruby licence (Ryby's / GPLv2 dual)
7
+
8
+ require 'bio-ucsc'
9
+ describe "Bio::Ucsc::Hg18::DBConnection" do
10
+
11
+ describe ".new" do
12
+ context "given no argument" do
13
+ it "establishs the hg19 connection without exceptions" do
14
+ expect{Bio::Ucsc::Hg18::DBConnection.connect}.not_to raise_error
15
+ end
16
+ end
17
+ end
18
+
19
+ describe ".db_host" do
20
+ context "given no atgument" do
21
+ it "returns the default" do
22
+ Bio::Ucsc::Hg18::DBConnection.db_host.should == "genome-mysql.cse.ucsc.edu"
23
+ end
24
+ end
25
+ end
26
+
27
+ describe ".db_host=" do
28
+ context 'given ="localhost"' do
29
+ it "changes default hostname" do
30
+ Bio::Ucsc::Hg18::DBConnection.db_host = "localhost"
31
+ Bio::Ucsc::Hg18::DBConnection.db_host.should == "localhost"
32
+ end
33
+ end
34
+ end
35
+
36
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg18::Dgv" 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::Hg18::DBConnection.default
8
+ Bio::Ucsc::Hg18::DBConnection.connect
9
+ i = Bio::GenomicInterval.parse("chr1:1-20000")
10
+ Bio::Ucsc::Hg18::Dgv.find_by_interval(i).should have(11).items
11
+ end
12
+
13
+ it "returens an array of results with column accessors" do
14
+ Bio::Ucsc::Hg18::DBConnection.default
15
+ Bio::Ucsc::Hg18::DBConnection.connect
16
+ i = Bio::GenomicInterval.parse("chr1:1-20000")
17
+ r = Bio::Ucsc::Hg18::Dgv.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::Hg18::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::Hg18::DBConnection.default
8
+ Bio::Ucsc::Hg18::DBConnection.connect
9
+ i = Bio::GenomicInterval.parse("chr1:1-100,000")
10
+ Bio::Ucsc::Hg18::RefGene.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::Hg18::DBConnection.default
15
+ Bio::Ucsc::Hg18::DBConnection.connect
16
+ i = Bio::GenomicInterval.parse("chr1:1-100,000")
17
+ r = Bio::Ucsc::Hg18::RefGene.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,33 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg18::Rmsk" do
3
+
4
+ describe "::Chr1_Rmsk#find_by_interval" do
5
+ context "given range chr1:1-10,000" do
6
+ it "returens an array of results" do
7
+ Bio::Ucsc::Hg18::DBConnection.default
8
+ Bio::Ucsc::Hg18::DBConnection.connect
9
+ i = Bio::GenomicInterval.parse("chr1:1-10,000")
10
+ Bio::Ucsc::Hg18::Rmsk::Chr1_Rmsk.find_by_interval(i).should have(8).items
11
+ end
12
+ end
13
+ end
14
+
15
+ describe "#find_by_interval" do
16
+ context "given range chr3:1-100,000" do
17
+ it "returens an array of results" do
18
+ Bio::Ucsc::Hg18::DBConnection.default
19
+ Bio::Ucsc::Hg18::DBConnection.connect
20
+ i = Bio::GenomicInterval.parse("chr3:1-100,000")
21
+ Bio::Ucsc::Hg18::Rmsk.find_by_interval(i).should have(126).items
22
+ end
23
+
24
+ it "returens an array of results with column accessors" do
25
+ Bio::Ucsc::Hg18::DBConnection.default
26
+ Bio::Ucsc::Hg18::DBConnection.connect
27
+ i = Bio::GenomicInterval.parse("chr3:1-100,000")
28
+ r = Bio::Ucsc::Hg18::Rmsk.find_by_interval(i)
29
+ r[0].genoName.should == "chr3"
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::CcdsGene" 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::RefGene.find_by_interval(i).should have(29).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::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::CytoBand" do
3
+
4
+ describe "#find_by_INTERVAL" do
5
+ context "given range chr1:1-5,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-5,000,000")
10
+ Bio::Ucsc::Hg19::CytoBand.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-5,000,000")
17
+ r = Bio::Ucsc::Hg19::CytoBand.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,37 @@
1
+ #
2
+ # = /spec/hg19_spec.rb - Rspec specification for Ucsc::Hg19
3
+ #
4
+ # Copyright:: Cioyrught (C) 2011
5
+ # MISHIMA, Hiroyuki <missy at be.to / hmishima at nagasaki-u.ac.jp>
6
+ # License:: Ruby licence (Ryby's / GPLv2 dual)
7
+
8
+ require 'bio-ucsc'
9
+
10
+ describe "Bio::Ucsc::Hg19::DBConnection" do
11
+
12
+ describe ".new" do
13
+ context "given no argument" do
14
+ it "establishs the hg19 connection without exceptions" do
15
+ expect{Bio::Ucsc::Hg19::DBConnection.connect}.not_to raise_error
16
+ end
17
+ end
18
+ end
19
+
20
+ describe ".db_host" do
21
+ context "given no atgument" do
22
+ it "returns the default" do
23
+ Bio::Ucsc::Hg19::DBConnection.db_host.should == "genome-mysql.cse.ucsc.edu"
24
+ end
25
+ end
26
+ end
27
+
28
+ describe ".db_host=" do
29
+ context 'given ="localhost"' do
30
+ it "changes default hostname" do
31
+ Bio::Ucsc::Hg19::DBConnection.db_host = "localhost"
32
+ Bio::Ucsc::Hg19::DBConnection.db_host.should == "localhost"
33
+ end
34
+ end
35
+ end
36
+
37
+ end
@@ -0,0 +1,23 @@
1
+ require 'bio-ucsc'
2
+ describe "Bio::Ucsc::Hg19::Dgv" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-20,000" do
6
+ it "returens an array of results" do
7
+ Bio::Ucsc::Hg19::DBConnection.default
8
+ Bio::Ucsc::Hg19::DBConnection.connect
9
+ s = Bio::GenomicInterval.parse("chr1:1-20,000")
10
+ Bio::Ucsc::Hg19::Dgv.find_by_interval(s).should have(9).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
+ s = Bio::GenomicInterval.parse("chr1:1-20,000")
17
+ r = Bio::Ucsc::Hg19::Dgv.find_by_interval(s)
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::EnsGene" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-500,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-500,000")
10
+ Bio::Ucsc::Hg19::EnsGene.find_by_interval(i).should have(60).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-500,000")
17
+ r = Bio::Ucsc::Hg19::EnsGene.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::GwasCatalog" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-5,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-5,000,000")
10
+ Bio::Ucsc::Hg19::GwasCatalog.find_by_interval(i).should have(8).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-5,000,000")
17
+ r = Bio::Ucsc::Hg19::GwasCatalog.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::HapMapAllelesChimp" 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::HapMapAllelesChimp.find_by_interval(i).should have(48).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::HapMapAllelesChimp.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::HapMapAllelesMacaque" 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::HapMapAllelesMacaque.find_by_interval(i).should have(49).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::HapMapAllelesMacaque.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::HapMapSnpsASW" do
3
+
4
+ describe "#find_by_interval" do
5
+ context "given range chr1:1-800,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-800,000")
10
+ Bio::Ucsc::Hg19::HapMapSnpsASW.find_by_interval(i).should have(22).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-800,000")
17
+ r = Bio::Ucsc::Hg19::HapMapSnpsASW.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::HapMapSnpsCEU" 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::HapMapSnpsCEU.find_by_interval(i).should have(41).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::HapMapSnpsCEU.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::HapMapSnpsCHB" 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::HapMapSnpsCHB.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::HapMapSnpsCHB.find_by_interval(i)
18
+ r[0].chrom.should == "chr1"
19
+ end
20
+ end
21
+ end
22
+
23
+ end