summaryrefslogtreecommitdiff
path: root/model.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-11-24 13:10:52 +0100
committerChristoph Helma <helma@in-silico.ch>2010-11-24 13:10:52 +0100
commit1952b3ed877e4791429512def5bd7102e4ba7a99 (patch)
tree624d3fde40b7abd2ae902e9635b1a1dcfa5df2b0 /model.rb
parent99e3566a11a1d51df91a6d3d016e8ec260920020 (diff)
opentox-ruby-api-wrapper renamed to opentox-ruby
Diffstat (limited to 'model.rb')
-rw-r--r--model.rb42
1 files changed, 22 insertions, 20 deletions
diff --git a/model.rb b/model.rb
index da12f0b..9929ab0 100644
--- a/model.rb
+++ b/model.rb
@@ -5,19 +5,23 @@ class ToxCreateModel
property :id, Serial
property :name, String, :length => 255
property :warnings, Text, :length => 2**32-1
+ property :error_messages, Text, :length => 2**32-1 # :errors interferes with datamapper validation
property :type, String
+ property :status, String, :length => 255
property :created_at, DateTime
property :task_uri, String, :length => 255
property :uri, String, :length => 255
- property :validation_task_uri, String, :length => 255
+ property :training_dataset, String, :length => 255
+ property :feature_dataset, String, :length => 255
+ #property :validation_task_uri, String, :length => 255
property :validation_uri, String, :length => 255
- property :validation_report_task_uri, String, :length => 255
+ #property :validation_report_task_uri, String, :length => 255
property :validation_report_uri, String, :length => 255
- property :validation_qmrf_task_uri, String, :length => 255
+ #property :validation_qmrf_task_uri, String, :length => 255
property :validation_qmrf_uri, String, :length => 255
property :nr_compounds, Integer
@@ -34,13 +38,16 @@ class ToxCreateModel
property :root_mean_squared_error, Float
property :mean_absolute_error, Float
- def status
+=begin
+def status
#begin
RestClient.get(File.join(@task_uri, 'hasStatus')).body
#rescue
# "Service offline"
#end
end
+=end
+=begin
def validation_status
begin
@@ -92,29 +99,23 @@ class ToxCreateModel
def process
+ LOGGER.debug self.to_yaml
+
if @uri.nil? and status == "Completed"
- update :uri => RestClient.get(File.join(@task_uri, 'resultURI')).body
- lazar = YAML.load(RestClient.get(@uri, :accept => "application/x-yaml").body)
- case lazar.dependentVariables
- when /classification/
- update :type => "classification"
- when /regression/
- update :type => "regression"
- else
- update :type => "unknown"
- end
+ #update :uri => RestClient.get(File.join(@task_uri, 'resultURI')).body
+ #lazar = YAML.load(RestClient.get(@uri, :accept => "application/x-yaml").body)
elsif @validation_uri.nil? and validation_status == "Completed"
begin
- update :validation_uri => RestClient.get(File.join(@validation_task_uri, 'resultURI')).body
- LOGGER.debug "Validation URI: #{@validation_uri}"
+ #update :validation_uri => RestClient.get(File.join(@validation_task_uri, 'resultURI')).body
+ #LOGGER.debug "Validation URI: #{@validation_uri}"
- update :validation_report_task_uri => RestClient.post(File.join(@@config[:services]["opentox-validation"],"/report/crossvalidation"), :validation_uris => @validation_uri).body
- LOGGER.debug "Validation Report Task URI: #{@validation_report_task_uri}"
+ #update :validation_report_task_uri => RestClient.post(File.join(CONFIG[:services]["opentox-validation"],"/report/crossvalidation"), :validation_uris => @validation_uri).body
+ #LOGGER.debug "Validation Report Task URI: #{@validation_report_task_uri}"
- update :validation_qmrf_task_uri => RestClient.post(File.join(@@config[:services]["opentox-validation"],"/reach_report/qmrf"), :model_uri => @uri).body
- LOGGER.debug "QMRF Report Task URI: #{@validation_qmrf_task_uri}"
+ #update :validation_qmrf_task_uri => RestClient.post(File.join(CONFIG[:services]["opentox-validation"],"/reach_report/qmrf"), :model_uri => @uri).body
+ #LOGGER.debug "QMRF Report Task URI: #{@validation_qmrf_task_uri}"
uri = File.join(@validation_uri, 'statistics')
yaml = RestClient.get(uri).body
@@ -178,6 +179,7 @@ class ToxCreateModel
end
end
+=end
end