biomart 0.1.4 → 0.1.5
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.
- data/History.txt +7 -0
- data/biomart.gemspec +2 -2
- data/lib/biomart.rb +1 -1
- data/lib/biomart/dataset.rb +6 -2
- data/test/test_biomart.rb +17 -3
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
=== 0.1.5 2010-02-04
|
2
|
+
|
3
|
+
* 1 major bugfix:
|
4
|
+
* Poorly formatted tab-separated data (coming from biomart) was not
|
5
|
+
being processed correctly (as a result some data was being dropped).
|
6
|
+
This hole has now been fixed...
|
7
|
+
|
1
8
|
=== 0.1.4 2010-01-20
|
2
9
|
|
3
10
|
* 1 minor enhancement:
|
data/biomart.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{biomart}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Darren Oakley"]
|
9
|
-
s.date = %q{2010-
|
9
|
+
s.date = %q{2010-02-04}
|
10
10
|
s.description = %q{A ruby API for interacting with Biomart services.}
|
11
11
|
s.email = ["daz.oakley@gmail.com"]
|
12
12
|
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
|
data/lib/biomart.rb
CHANGED
data/lib/biomart/dataset.rb
CHANGED
@@ -256,9 +256,13 @@ module Biomart
|
|
256
256
|
|
257
257
|
if elements.size == 0
|
258
258
|
# This is a bad line (causing the above Exception), try and use split to recover.
|
259
|
-
# Alse add an empty value as split will miss the final value...
|
260
259
|
elements = line.split("\t")
|
261
|
-
|
260
|
+
if line =~ /\t$/
|
261
|
+
# If the last attribute resturn is empty add a nil
|
262
|
+
# value to the array as it would have been missed
|
263
|
+
# by the split function!
|
264
|
+
elements.push(nil)
|
265
|
+
end
|
262
266
|
|
263
267
|
# Substitute blank strings for nils
|
264
268
|
elements.map! do |elem|
|
data/test/test_biomart.rb
CHANGED
@@ -43,6 +43,7 @@ class BiomartTest < Test::Unit::TestCase
|
|
43
43
|
@htgt_targ = @htgt.datasets["htgt_targ"]
|
44
44
|
@htgt_trap = @htgt.datasets["htgt_trap"]
|
45
45
|
@kermits = @htgt.datasets["kermits"]
|
46
|
+
@emma = Biomart::Dataset.new( "http://www.emmanet.org/biomart", { :name => "strains" } )
|
46
47
|
end
|
47
48
|
|
48
49
|
should "have basic metadata" do
|
@@ -105,9 +106,22 @@ class BiomartTest < Test::Unit::TestCase
|
|
105
106
|
"is_latest_for_gene", "targeted_trap"
|
106
107
|
]
|
107
108
|
)
|
108
|
-
assert( search.is_a?( Hash ), "Biomart::Dataset.search (no options) is not returning a hash." )
|
109
|
-
assert( search[:data].is_a?( Array ), "Biomart::Dataset.search[:data] (no options) is not returning an array." )
|
110
|
-
assert( search[:data].size >
|
109
|
+
assert( search.is_a?( Hash ), "Biomart::Dataset.search (no options) is not returning a hash. (HTGT Query)" )
|
110
|
+
assert( search[:data].is_a?( Array ), "Biomart::Dataset.search[:data] (no options) is not returning an array. (HTGT Query)" )
|
111
|
+
assert( search[:data].size > 20, "Biomart::Dataset.search[:data] for poorly formatted TSV data is empty. (HTGT Query)" )
|
112
|
+
|
113
|
+
search2 = @emma.search(
|
114
|
+
:filters => { "emma_id" => ["EM:03629"] },
|
115
|
+
:attributes => [
|
116
|
+
"emma_id", "international_strain_name", "synonym", "maintained_background",
|
117
|
+
"mutation_main_type", "mutation_sub_type", "alls_form", "genetic_description",
|
118
|
+
"phenotype_description", "reference", "pubmed_id", "availability", "owner"
|
119
|
+
]
|
120
|
+
)
|
121
|
+
|
122
|
+
assert( search2.is_a?( Hash ), "Biomart::Dataset.search (no options) is not returning a hash. (EMMA Query)" )
|
123
|
+
assert( search2[:data].is_a?( Array ), "Biomart::Dataset.search[:data] (no options) is not returning an array. (EMMA Query)" )
|
124
|
+
assert( search2[:data].size > 0, "Biomart::Dataset.search[:data] for poorly formatted TSV data is empty. (EMMA Query)" )
|
111
125
|
end
|
112
126
|
|
113
127
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biomart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Oakley
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-02-04 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|