search_biomodel 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/search_biomodel.rb +23 -4
- data/search_biomodel.gemspec +2 -3
- data/test/test_search_biomodel.rb +30 -6
- metadata +4 -5
- data/test.rb +0 -24
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/lib/search_biomodel.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
|
2
|
+
|
1
3
|
require 'rubygems'
|
2
4
|
require 'savon'
|
3
5
|
|
@@ -8,7 +10,7 @@ module SysMODB
|
|
8
10
|
end
|
9
11
|
|
10
12
|
module SearchBiomodel
|
11
|
-
|
13
|
+
|
12
14
|
def search_by_ChEBIID(search_string)
|
13
15
|
client = create_connection
|
14
16
|
response = client.request(:biom, "get_models_id_by_ch_ebi_id") do
|
@@ -35,6 +37,23 @@ module SysMODB
|
|
35
37
|
return response.to_hash[:get_models_id_by_name_response][:get_models_id_by_name_return][:get_models_id_by_name_return]
|
36
38
|
end
|
37
39
|
|
40
|
+
def get_models_id_by_person (search_string)
|
41
|
+
client = create_connection
|
42
|
+
response = client.request(:biom, "get_models_id_by_person") do
|
43
|
+
soap.body = { :personName => search_string, :attributes! => { :personName => { "xsi:type" => "xsd:string" } } }
|
44
|
+
end
|
45
|
+
return response.to_hash[:get_models_id_by_person_response][:get_models_id_by_person_return][:get_models_id_by_person_return]
|
46
|
+
end
|
47
|
+
|
48
|
+
def get_model_name_by_id (search_string)
|
49
|
+
client = create_connection
|
50
|
+
response = client.request(:biom, "get_model_name_by_id") do
|
51
|
+
soap.body = { :id => search_string, :attributes! => { :id => { "xsi:type" => "xsd:string" } } }
|
52
|
+
end
|
53
|
+
return response.to_hash[:get_model_name_by_id_response][:get_model_name_by_id_return]
|
54
|
+
end
|
55
|
+
|
56
|
+
|
38
57
|
|
39
58
|
private
|
40
59
|
|
@@ -45,9 +64,9 @@ module SysMODB
|
|
45
64
|
client = Savon::Client.new do
|
46
65
|
wsdl.document = "http://www.ebi.ac.uk/biomodels-main/services/BioModelsWebServices?wsdl"
|
47
66
|
wsdl.namespace = "http://biomodels.ebi.ac.uk"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
51
70
|
|
52
71
|
|
53
72
|
end #SearchBiomodel
|
data/search_biomodel.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{search_biomodel}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Niall Beard"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-07-05}
|
13
13
|
s.description = %q{Client package for creating, sending, recieving and consuming SOAP messages from BioModels search engine }
|
14
14
|
s.email = %q{beardn9@cs.man.ac.uk}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
|
|
26
26
|
"VERSION",
|
27
27
|
"lib/search_biomodel.rb",
|
28
28
|
"search_biomodel.gemspec",
|
29
|
-
"test.rb",
|
30
29
|
"test/helper.rb",
|
31
30
|
"test/test_search_biomodel.rb"
|
32
31
|
]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'test/unit'
|
2
|
-
require 'search_biomodel'
|
2
|
+
require '/home/cspc018/Work/Repos/gems/search_biomodel/lib/search_biomodel.rb'
|
3
3
|
|
4
4
|
|
5
5
|
class TestSearchBiomodel < Test::Unit::TestCase
|
@@ -7,30 +7,54 @@ class TestSearchBiomodel < Test::Unit::TestCase
|
|
7
7
|
include SysMODB::SearchBiomodel
|
8
8
|
|
9
9
|
def test_find_all_models
|
10
|
+
puts "\n\n ---------------------find all models---------------------\n\n"
|
10
11
|
response = []
|
11
12
|
i=0
|
12
13
|
response = get_all_models
|
13
|
-
response.each {|x| puts "
|
14
|
-
response.each {|x| assert_not_nil x[:
|
14
|
+
response.each {|x| puts "Response #{i+=1}: #{x[:key].to_s} "}
|
15
|
+
response.each {|x| assert_not_nil x[:key] }
|
16
|
+
assert_not_nil response
|
15
17
|
end
|
16
18
|
|
17
19
|
|
18
20
|
def test_search_by_ChEBIID
|
21
|
+
puts "\n\n ---------------------search by chebiid---------------------\n\n"
|
19
22
|
response = []
|
20
23
|
i = 0
|
21
24
|
response = search_by_ChEBIID("CHEBI:15422")
|
22
|
-
response.each {|x| puts "
|
25
|
+
response.each {|x| puts "Response #{i+=1}: #{x} "}
|
23
26
|
response.each {|x| assert_not_nil x }
|
27
|
+
assert_not_nil response
|
24
28
|
end
|
25
29
|
|
26
|
-
|
27
30
|
def test_search_by_name
|
31
|
+
puts "\n\n ---------------------model ID by name---------------------\n\n"
|
28
32
|
response = []
|
29
33
|
i = 0
|
30
34
|
response = search_by_name("Kolomeisky2003") #_MyosinV_Processivity")
|
31
|
-
response.each {|x| puts "
|
35
|
+
response.each {|x| puts "Response #{i+=1}: #{x} "}
|
32
36
|
response.each {|x| assert_not_nil x }
|
37
|
+
assert_not_nil response
|
33
38
|
end
|
39
|
+
|
40
|
+
|
41
|
+
def test_get_model_name_by_id
|
42
|
+
puts "\n\n ---------------------model name by ID---------------------\n\n"
|
43
|
+
response = get_model_name_by_id("BIOMD0000000190")
|
44
|
+
puts response
|
45
|
+
assert_not_nil response
|
46
|
+
end
|
47
|
+
|
48
|
+
|
34
49
|
|
50
|
+
def test_get_models_id_by_person
|
51
|
+
puts "\n\n ---------------------model ID by person---------------------\n\n"
|
52
|
+
response = []
|
53
|
+
i=0
|
54
|
+
response = get_models_id_by_person("Jim")
|
55
|
+
response.each {|x| puts "Response #{i+=1}: #{x} "}
|
56
|
+
response.each {|x| assert_not_nil x }
|
57
|
+
assert_not_nil response
|
58
|
+
end
|
35
59
|
|
36
60
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: search_biomodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Niall Beard
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-05 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -83,7 +83,6 @@ files:
|
|
83
83
|
- VERSION
|
84
84
|
- lib/search_biomodel.rb
|
85
85
|
- search_biomodel.gemspec
|
86
|
-
- test.rb
|
87
86
|
- test/helper.rb
|
88
87
|
- test/test_search_biomodel.rb
|
89
88
|
has_rdoc: true
|
data/test.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
#require '/home/cspc018/Work/Repos/gems/search_biomodel/lib/search_biomodel.rb'
|
3
|
-
require 'seach_biomodel'
|
4
|
-
|
5
|
-
|
6
|
-
include SysMODB::SearchBiomodel
|
7
|
-
|
8
|
-
puts "\n\n ------------------ List All -----------------------------\n\n"
|
9
|
-
all_models = get_all_models
|
10
|
-
all_models.each { |item| puts "ID = #{item[:key]} | NAME = #{item[:value]}\n" }
|
11
|
-
|
12
|
-
|
13
|
-
puts "\n\n ------------------ By Chebiid --------------------------\n\n"
|
14
|
-
i=0
|
15
|
-
models_by_chebiid = search_by_ChEBIID("CHEBI:15422")
|
16
|
-
models_by_chebiid.each { |item| puts "#{i+=1} #{item.to_s}\n"}
|
17
|
-
|
18
|
-
|
19
|
-
puts "\n\n ------------------ By Name -----------------------------\n\n"
|
20
|
-
i=0
|
21
|
-
models_by_name = search_by_name("Kolomeisky2003")
|
22
|
-
models_by_name.each { |item| puts "#{i+=1} #{item.to_s}\n"}
|
23
|
-
|
24
|
-
puts "\n ----------------------------------------------------------\n\n\n"
|