helma-opentox-ruby-api-wrapper 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/Rakefile +0 -1
- data/VERSION +1 -1
- data/lib/opentox-ruby-api-wrapper.rb +10 -9
- data/opentox-ruby-api-wrapper.gemspec +1 -4
- metadata +1 -11
data/Rakefile
CHANGED
@@ -11,7 +11,6 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/helma/opentox-ruby-api-wrapper"
|
12
12
|
gem.authors = ["Christoph Helma"]
|
13
13
|
gem.add_dependency "rest-client"
|
14
|
-
gem.add_dependency "crack"
|
15
14
|
gem.add_development_dependency "thoughtbot-shoulda"
|
16
15
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
16
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
#['rubygems', 'rest_client', 'spork', 'helper' ].each do |lib|
|
3
|
+
['rubygems', 'rest_client', 'spork' ].each do |lib|
|
2
4
|
require lib
|
3
5
|
end
|
4
6
|
|
@@ -102,12 +104,7 @@ module OpenTox
|
|
102
104
|
|
103
105
|
# Get all compounds and features from a dataset, returns a hash with compound_uris as keys and arrays of features as values
|
104
106
|
def all_compounds_and_features
|
105
|
-
|
106
|
-
Crack::XML.parse(RestClient.get @uri + '/compounds/features')['dataset']['compound'].each do |c|
|
107
|
-
features = c['feature_uri'].collect{ |f| Feature.new :uri => f }
|
108
|
-
compounds[c['uri']] = features
|
109
|
-
end
|
110
|
-
compounds
|
107
|
+
YAML.load(RestClient.get(@uri + '/compounds/features'))
|
111
108
|
end
|
112
109
|
|
113
110
|
# Get all features from a dataset
|
@@ -143,8 +140,12 @@ module OpenTox
|
|
143
140
|
class Lazar < OpenTox
|
144
141
|
|
145
142
|
# Create a new prediction model from a dataset
|
146
|
-
def initialize(
|
147
|
-
|
143
|
+
def initialize(params)
|
144
|
+
if params[:uri]
|
145
|
+
@uri = params[:uri]
|
146
|
+
elsif params[:dataset_ur]
|
147
|
+
@uri = RestClient.post ENV['OPENTOX_LAZAR'] + 'models/' , :dataset_uri => training_dataset.uri
|
148
|
+
end
|
148
149
|
end
|
149
150
|
|
150
151
|
# Predict a compound
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{opentox-ruby-api-wrapper}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Christoph Helma"]
|
@@ -46,16 +46,13 @@ Gem::Specification.new do |s|
|
|
46
46
|
|
47
47
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
48
48
|
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
49
|
-
s.add_runtime_dependency(%q<crack>, [">= 0"])
|
50
49
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
51
50
|
else
|
52
51
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
53
|
-
s.add_dependency(%q<crack>, [">= 0"])
|
54
52
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
55
53
|
end
|
56
54
|
else
|
57
55
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
58
|
-
s.add_dependency(%q<crack>, [">= 0"])
|
59
56
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
60
57
|
end
|
61
58
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helma-opentox-ruby-api-wrapper
|
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
|
- Christoph Helma
|
@@ -22,16 +22,6 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: "0"
|
24
24
|
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: crack
|
27
|
-
type: :runtime
|
28
|
-
version_requirement:
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: "0"
|
34
|
-
version:
|
35
25
|
- !ruby/object:Gem::Dependency
|
36
26
|
name: thoughtbot-shoulda
|
37
27
|
type: :development
|