biomart 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -3
- data/History.txt +7 -1
- data/biomart.gemspec +2 -1
- data/lib/biomart/dataset.rb +4 -4
- data/lib/biomart/version.rb +1 -1
- data/test/test_biomart.rb +22 -6
- data/test/test_helper.rb +1 -0
- metadata +16 -22
data/Gemfile.lock
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
biomart (0.2.
|
5
|
-
builder
|
4
|
+
biomart (0.2.2)
|
5
|
+
builder (>= 3.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
10
|
+
awesome_print (0.4.0)
|
11
|
+
builder (3.0.0)
|
11
12
|
shoulda (2.11.3)
|
12
13
|
simplecov (0.4.0)
|
13
14
|
simplecov-html (~> 0.4.0)
|
@@ -17,6 +18,7 @@ PLATFORMS
|
|
17
18
|
ruby
|
18
19
|
|
19
20
|
DEPENDENCIES
|
21
|
+
awesome_print
|
20
22
|
biomart!
|
21
23
|
shoulda (>= 2.10)
|
22
24
|
simplecov
|
data/History.txt
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
=== 0.2.
|
1
|
+
=== 0.2.3 2011-07-14
|
2
|
+
|
3
|
+
* 2 minor bugfixes:
|
4
|
+
* More robust parsing of the TSV from biomart
|
5
|
+
* Stop creating lots of unnecessary filter objects
|
6
|
+
|
7
|
+
=== 0.2.2 2011-02-18
|
2
8
|
|
3
9
|
* 1 major bugfix:
|
4
10
|
* More forceful filter checking in 0.2.1 was causing queries on 'pointerFilters' to error out unnecessarily.
|
data/biomart.gemspec
CHANGED
@@ -19,7 +19,8 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_runtime_dependency("builder", [">= 0"])
|
22
|
+
s.add_runtime_dependency("builder", [">= 3.0"])
|
23
23
|
s.add_development_dependency("shoulda", [">= 2.10"])
|
24
24
|
s.add_development_dependency("simplecov", [">= 0"])
|
25
|
+
s.add_development_dependency("awesome_print", [">= 0"])
|
25
26
|
end
|
data/lib/biomart/dataset.rb
CHANGED
@@ -223,7 +223,7 @@ module Biomart
|
|
223
223
|
if f.attributes["displayType"] != nil
|
224
224
|
next if f.attributes["displayType"] == "container"
|
225
225
|
@filters[ f.attributes["internalName"] ] = Filter.new( f.attributes )
|
226
|
-
|
226
|
+
elsif f.attributes["pointerFilter"] != nil
|
227
227
|
pointer_filter = Filter.new( f.attributes )
|
228
228
|
@filters[ pointer_filter.name ] = pointer_filter
|
229
229
|
@filters[ pointer_filter.pointer_filter ] = pointer_filter
|
@@ -337,7 +337,7 @@ module Biomart
|
|
337
337
|
else
|
338
338
|
# Ruby >= 1.9 CSV code
|
339
339
|
begin
|
340
|
-
parsed_data = CSV.parse( tsv, { :col_sep => "\t" } )
|
340
|
+
parsed_data = CSV.parse( tsv, { :col_sep => "\t", :skip_blanks => true } )
|
341
341
|
rescue CSV::MalformedCSVError => e
|
342
342
|
parsed_data = parse_tsv_line_by_line( headers.size, tsv )
|
343
343
|
end
|
@@ -378,11 +378,11 @@ module Biomart
|
|
378
378
|
|
379
379
|
if CSV.const_defined? :Reader
|
380
380
|
# Ruby < 1.9 CSV code
|
381
|
-
elements = CSV::parse_line( line, "\t" )
|
381
|
+
elements = CSV::parse_line( line, "\t" ) || []
|
382
382
|
else
|
383
383
|
# Ruby >= 1.9 CSV code
|
384
384
|
begin
|
385
|
-
elements = CSV::parse_line( line, { :col_sep => "\t" } )
|
385
|
+
elements = CSV::parse_line( line, { :col_sep => "\t" } ) || []
|
386
386
|
rescue CSV::MalformedCSVError => e
|
387
387
|
elements = []
|
388
388
|
end
|
data/lib/biomart/version.rb
CHANGED
data/test/test_biomart.rb
CHANGED
@@ -46,6 +46,7 @@ class BiomartTest < Test::Unit::TestCase
|
|
46
46
|
@htgt_trap = @htgt.datasets["htgt_trap"]
|
47
47
|
@kermits = @htgt.datasets["kermits"]
|
48
48
|
@ensembl = @htgt.datasets["mmusculus_gene_ensembl"]
|
49
|
+
@phenotyping = @htgt.datasets["phenotyping"]
|
49
50
|
@ensembl_var = Biomart::Dataset.new( "http://www.ensembl.org/biomart", { :name => "hsapiens_snp" } )
|
50
51
|
@emma = Biomart::Dataset.new( "http://www.emmanet.org/biomart", { :name => "strains" } )
|
51
52
|
@dcc = Biomart::Dataset.new( "http://www.knockoutmouse.org/biomart", { :name => "dcc" } )
|
@@ -75,11 +76,11 @@ class BiomartTest < Test::Unit::TestCase
|
|
75
76
|
htgt_count = @htgt_targ.count()
|
76
77
|
assert( htgt_count.is_a?( Integer ), "Biomart::Dataset.count is not returning integers." )
|
77
78
|
assert( htgt_count > 0, "Biomart::Dataset.count is returning zero - this is wrong!" )
|
78
|
-
|
79
|
+
|
79
80
|
htgt_count_single_filter = @htgt_targ.count( :filters => { "is_eucomm" => "1" } )
|
80
81
|
assert( htgt_count_single_filter.is_a?( Integer ), "Biomart::Dataset.count (with single filter) is not returning integers." )
|
81
82
|
assert( htgt_count_single_filter > 0, "Biomart::Dataset.count (with single filter) is returning zero - this is wrong!" )
|
82
|
-
|
83
|
+
|
83
84
|
htgt_count_single_filter_group_value = @htgt_targ.count( :filters => { "marker_symbol" => ["Cbx1","Cbx7","Art4"] } )
|
84
85
|
assert( htgt_count_single_filter_group_value.is_a?( Integer ), "Biomart::Dataset.count (with single filter, group value) is not returning integers." )
|
85
86
|
assert( htgt_count_single_filter_group_value > 0, "Biomart::Dataset.count (with single filter, group value) is returning zero - this is wrong!" )
|
@@ -89,12 +90,12 @@ class BiomartTest < Test::Unit::TestCase
|
|
89
90
|
search = @htgt_trap.search()
|
90
91
|
assert( search.is_a?( Hash ), "Biomart::Dataset.search (no options) is not returning a hash." )
|
91
92
|
assert( search[:data].is_a?( Array ), "Biomart::Dataset.search[:data] (no options) is not returning an array." )
|
92
|
-
|
93
|
+
|
93
94
|
search1 = @htgt_targ.search( :filters => { "marker_symbol" => "Cbx1" }, :process_results => true )
|
94
95
|
assert( search1.is_a?( Array ), "Biomart::Dataset.search (filters defined with processing) is not returning an array." )
|
95
96
|
assert( search1.first.is_a?( Hash ), "Biomart::Dataset.search (filters defined with processing) is not returning an array of hashes." )
|
96
97
|
assert( search1.first["marker_symbol"] == "Cbx1", "Biomart::Dataset.search (filters defined with processing) is not returning the correct info." )
|
97
|
-
|
98
|
+
|
98
99
|
search2 = @htgt_targ.search( :filters => { "marker_symbol" => "Cbx1" }, :attributes => ["marker_symbol","ensembl_gene_id"], :process_results => true )
|
99
100
|
assert( search2.is_a?( Array ), "Biomart::Dataset.search (filters and attributes defined with processing) is not returning an array." )
|
100
101
|
assert( search2.first.is_a?( Hash ), "Biomart::Dataset.search (filters and attributes defined with processing) is not returning an array of hashes." )
|
@@ -143,6 +144,20 @@ class BiomartTest < Test::Unit::TestCase
|
|
143
144
|
assert( search2.is_a?( Hash ), "Biomart::Dataset.search (no options) is not returning a hash. (EMMA Query)" )
|
144
145
|
assert( search2[:data].is_a?( Array ), "Biomart::Dataset.search[:data] (no options) is not returning an array. (EMMA Query)" )
|
145
146
|
assert( search2[:data].size > 0, "Biomart::Dataset.search[:data] for poorly formatted TSV data is empty. (EMMA Query)" )
|
147
|
+
|
148
|
+
search3 = @phenotyping.search(
|
149
|
+
:timeout => 240,
|
150
|
+
:filters => {},
|
151
|
+
:attributes => [
|
152
|
+
'param_level_heatmap_colony_prefix',
|
153
|
+
'param_level_heatmap_mp_id',
|
154
|
+
'param_level_heatmap_mp_term'
|
155
|
+
]
|
156
|
+
)
|
157
|
+
|
158
|
+
assert( search3.is_a?( Hash ), "Biomart::Dataset.search (no options) is not returning a hash. (MGP Phenotyping Query)" )
|
159
|
+
assert( search3[:data].is_a?( Array ), "Biomart::Dataset.search[:data] (no options) is not returning an array. (MGP Phenotyping Query)" )
|
160
|
+
assert( search3[:data].size > 0, "Biomart::Dataset.search[:data] for poorly formatted TSV data is empty. (MGP Phenotyping Query)" )
|
146
161
|
end
|
147
162
|
|
148
163
|
should "perform federated search queries" do
|
@@ -169,7 +184,7 @@ class BiomartTest < Test::Unit::TestCase
|
|
169
184
|
assert( results[:data].is_a?(Array), "Biomart::Dataset.search[:data] is not returning an array. [federated search]" )
|
170
185
|
assert( results[:data][0].size === 3, "Biomart::Dataset.search[:data] is not returning 3 attributes. [federated search]" )
|
171
186
|
assert( results[:headers].size === 3, "Biomart::Dataset.search[:headers] is not returning 3 elements. [federated search]" )
|
172
|
-
|
187
|
+
|
173
188
|
assert_raise( Biomart::ArgumentError ) { @htgt_targ.count( search_opts ) }
|
174
189
|
|
175
190
|
assert_raise Biomart::ArgumentError do
|
@@ -260,7 +275,8 @@ class BiomartTest < Test::Unit::TestCase
|
|
260
275
|
search_opts = {
|
261
276
|
:filters => { 'with_variation_annotation' => true, 'ensembl_gene' => 'ENSG00000244734' },
|
262
277
|
:attributes => [ 'refsnp_id','chr_name','chrom_start' ],
|
263
|
-
:process_results => true
|
278
|
+
:process_results => true,
|
279
|
+
:timeout => 1000
|
264
280
|
}
|
265
281
|
|
266
282
|
true_results = {}
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biomart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 2
|
9
|
-
version: 0.2.2
|
4
|
+
prerelease:
|
5
|
+
version: 0.2.3
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Darren Oakley
|
@@ -14,8 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
18
|
-
default_executable:
|
13
|
+
date: 2011-07-14 00:00:00 Z
|
19
14
|
dependencies:
|
20
15
|
- !ruby/object:Gem::Dependency
|
21
16
|
name: builder
|
@@ -25,9 +20,7 @@ dependencies:
|
|
25
20
|
requirements:
|
26
21
|
- - ">="
|
27
22
|
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
23
|
+
version: "3.0"
|
31
24
|
type: :runtime
|
32
25
|
version_requirements: *id001
|
33
26
|
- !ruby/object:Gem::Dependency
|
@@ -38,9 +31,6 @@ dependencies:
|
|
38
31
|
requirements:
|
39
32
|
- - ">="
|
40
33
|
- !ruby/object:Gem::Version
|
41
|
-
segments:
|
42
|
-
- 2
|
43
|
-
- 10
|
44
34
|
version: "2.10"
|
45
35
|
type: :development
|
46
36
|
version_requirements: *id002
|
@@ -52,11 +42,20 @@ dependencies:
|
|
52
42
|
requirements:
|
53
43
|
- - ">="
|
54
44
|
- !ruby/object:Gem::Version
|
55
|
-
segments:
|
56
|
-
- 0
|
57
45
|
version: "0"
|
58
46
|
type: :development
|
59
47
|
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: awesome_print
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
type: :development
|
58
|
+
version_requirements: *id004
|
60
59
|
description: A ruby API for interacting with Biomart XML based webservices.
|
61
60
|
email:
|
62
61
|
- daz.oakley@gmail.com
|
@@ -89,7 +88,6 @@ files:
|
|
89
88
|
- tasks/yard.rake
|
90
89
|
- test/test_biomart.rb
|
91
90
|
- test/test_helper.rb
|
92
|
-
has_rdoc: true
|
93
91
|
homepage: http://github.com/dazoakley/biomart
|
94
92
|
licenses: []
|
95
93
|
|
@@ -103,21 +101,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
101
|
requirements:
|
104
102
|
- - ">="
|
105
103
|
- !ruby/object:Gem::Version
|
106
|
-
segments:
|
107
|
-
- 0
|
108
104
|
version: "0"
|
109
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
106
|
none: false
|
111
107
|
requirements:
|
112
108
|
- - ">="
|
113
109
|
- !ruby/object:Gem::Version
|
114
|
-
segments:
|
115
|
-
- 0
|
116
110
|
version: "0"
|
117
111
|
requirements: []
|
118
112
|
|
119
113
|
rubyforge_project: biomart
|
120
|
-
rubygems_version: 1.
|
114
|
+
rubygems_version: 1.8.5
|
121
115
|
signing_key:
|
122
116
|
specification_version: 3
|
123
117
|
summary: A ruby API for interacting with Biomart services.
|