diff options
author | Christoph Helma <helma@in-silico.ch> | 2011-03-03 12:57:43 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2011-03-03 12:57:43 +0100 |
commit | 8b46f5a4f389d7cd54f6e8b38025d275f9d3ed1b (patch) | |
tree | 3d786b2f371db0f097abf11438def17beac820cf /example.rb | |
parent | 5f243f1e9e0a8e12cd8a2267bcec3140d21bf445 (diff) | |
parent | d5378ac285f200a9a75b52030856c77f4697325f (diff) |
Merge branch 'development' of github.com:helma/opentox-validation into development
Conflicts:
application.rb
example.rb
report/report_persistance.rb
Diffstat (limited to 'example.rb')
-rw-r--r-- | example.rb | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -5,7 +5,7 @@ class Example @@file=File.new("data/hamster_carcinogenicity.yaml","r") @@file_type="text/x-yaml" - @@model=File.join @@config[:services]["opentox-model"],"1" + @@model=File.join CONFIG[:services]["opentox-model"],"1" @@feature= URI.encode("http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)") @@predicted_feature= URI.encode("http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)_lazar_classification") @@alg = File.join @@config[:services]["opentox-algorithm"],"lazar" @@ -28,7 +28,7 @@ class Example end file.close - sub = { "validation_service" => @@config[:services]["opentox-validation"].chomp("/"), + sub = { "validation_service" => CONFIG[:services]["opentox-validation"].chomp("/"), "validation_id" => "1", "model_uri" => @@model, "dataset_uri" => @@data, @@ -61,17 +61,17 @@ class Example ActiveRecord::Migrator.migrate('db/migrate', 1 ) ActiveRecord::Migrator.migrate('db/migrate', 2 ) - #delete_all(@@config[:services]["opentox-dataset"]) - log OpenTox::RestClientWrapper.delete @@config[:services]["opentox-dataset"] + #delete_all(CONFIG[:services]["opentox-dataset"]) + log OpenTox::RestClientWrapper.delete CONFIG[:services]["opentox-dataset"] log "upload dataset" halt 400,"File not found: "+@@file.path.to_s unless File.exist?(@@file.path) data = File.read(@@file.path) - data_uri = OpenTox::RestClientWrapper.post(@@config[:services]["opentox-dataset"],{:content_type => @@file_type},data).chomp("\n") + data_uri = OpenTox::RestClientWrapper.post(CONFIG[:services]["opentox-dataset"],{:content_type => @@file_type},data).chomp("\n") log "train-test-validation" - #delete_all(@@config[:services]["opentox-model"]) - OpenTox::RestClientWrapper.delete @@config[:services]["opentox-model"] + #delete_all(CONFIG[:services]["opentox-model"]) + OpenTox::RestClientWrapper.delete CONFIG[:services]["opentox-model"] split_params = Validation::Util.train_test_dataset_split(data_uri, URI.decode(@@feature), 0.9, 1) v = Validation::Validation.new :training_dataset_uri => split_params[:training_dataset_uri], @@ -87,7 +87,7 @@ class Example cv.perform_cv( @@alg_params ) log "create validation report" - rep = Reports::ReportService.new(File.join(@@config[:services]["opentox-validation"],"report")) + rep = Reports::ReportService.new(File.join(CONFIG[:services]["opentox-validation"],"report")) rep.delete_all_reports("validation") rep.create_report("validation",v.validation_uri) |