diff options
Diffstat (limited to 'nch/config.rb')
-rw-r--r-- | nch/config.rb | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/nch/config.rb b/nch/config.rb index 293cdc8..7a186bc 100644 --- a/nch/config.rb +++ b/nch/config.rb @@ -1,19 +1,22 @@ -#DATA = ["LOAEL-mol", "LOAEL-mg","MOU"] -DATA = ["MOU"] +#DATA = ["LOAEL-mol", "LOAEL-mg", "MOU"] +DATA = ["LOAEL-mol"] +#DATA = ["MOU"] URIS = { "LOAEL-mol"=>{ - # :dataset_uri=>"http://localhost:8083/dataset/3da90c55-0388-42a0-8ada-978abe4a515c", - # :prediction_feature=>"http://localhost:8084/feature/2a74d78d-5b3d-438c-a1e5-6cfb16bd9354", - # :new_feature_dataset_uri=>"http://localhost:8083/dataset/7de04de4-41ce-4528-97c2-fd92fbb4d0b8", - # :orig_feature_dataset_uri=>"http://localhost:8083/dataset/e9016641-dddb-434f-bb05-63d80a37679a", + :dataset_uri=>"http://localhost:8083/dataset/3da90c55-0388-42a0-8ada-978abe4a515c", + :prediction_feature=>"http://localhost:8084/feature/2a74d78d-5b3d-438c-a1e5-6cfb16bd9354", + :new_feature_dataset_uri=>"http://localhost:8083/dataset/7de04de4-41ce-4528-97c2-fd92fbb4d0b8", + :orig_feature_dataset_uri=>"http://localhost:8083/dataset/e9016641-dddb-434f-bb05-63d80a37679a", + :all_feature_dataset_uri=>"http://localhost:8083/dataset/bc551e60-b2e7-4fb9-9aa3-52433ac1358c", + :ob_feature_dataset_uri=>"http://localhost:8083/dataset/ac44674f-efa9-4cf9-b1ff-37e63e3cf8aa", }, "LOAEL-mg"=>{ - # :dataset_uri=>"http://localhost:8083/dataset/4f3b9de4-0494-4339-8ebd-e6c6c1984a23", - # :prediction_feature=>"http://localhost:8084/feature/ba5b0f78-36bc-4ac3-8020-9d8b2ca3bd13", - # :new_feature_dataset_uri=>"http://localhost:8083/dataset/7de04de4-41ce-4528-97c2-fd92fbb4d0b8", - # :orig_feature_dataset_uri=>"http://localhost:8083/dataset/e9016641-dddb-434f-bb05-63d80a37679a", + :dataset_uri=>"http://localhost:8083/dataset/4f3b9de4-0494-4339-8ebd-e6c6c1984a23", + :prediction_feature=>"http://localhost:8084/feature/ba5b0f78-36bc-4ac3-8020-9d8b2ca3bd13", + :new_feature_dataset_uri=>"http://localhost:8083/dataset/7de04de4-41ce-4528-97c2-fd92fbb4d0b8", + :orig_feature_dataset_uri=>"http://localhost:8083/dataset/e9016641-dddb-434f-bb05-63d80a37679a", }, "MOU"=>{ # :dataset_uri=>"http://localhost:8083/dataset/f0af478a-51e6-41a5-adb2-d1a9bedf8981", @@ -70,6 +73,38 @@ def test_dataset_uri(d) end end +def all_feature_dataset_uri(d) + if URIS[d] and URIS[d][:all_feature_dataset_uri] + URIS[d][:all_feature_dataset_uri] + else + u_dataset = OpenTox::Dataset.new + u_dataset.upload File.join("data/03/#{d}_uniq.csv") + puts "Unique Dataset: "+u_dataset.uri + info(u_dataset) + @descriptors = OpenTox::Algorithm::Descriptor.physchem_descriptors.keys - ["Cdk.IPMolecularLearning"] + all_feat_uri = wait_for_task(OpenTox::RestClientWrapper.post("http://localhost:8081/algorithm/descriptor/physchem",{:dataset_uri => u_dataset.uri, :descriptors => @descriptors})) + f_dataset = OpenTox::Dataset.new all_feat_uri + info(f_dataset) + plz_add "all_feature_dataset_uri #{all_feat_uri}" + end +end + +def ob_feature_dataset_uri(d) + if URIS[d] and URIS[d][:ob_feature_dataset_uri] + URIS[d][:ob_feature_dataset_uri] + else + u_dataset = OpenTox::Dataset.new + u_dataset.upload File.join("data/03/#{d}_uniq.csv") + puts "Unique Dataset: "+u_dataset.uri + info(u_dataset) + @descriptors = OpenTox::Algorithm::Descriptor.physchem_descriptors.keys.keep_if{|x| x=~/^Openbabel\./} + ob_feat_uri = wait_for_task(OpenTox::RestClientWrapper.post("http://localhost:8081/algorithm/descriptor/physchem",{:dataset_uri => u_dataset.uri, :descriptors => @descriptors})) + f_dataset = OpenTox::Dataset.new ob_feat_uri + info(f_dataset) + plz_add "ob_feature_dataset_uri #{ob_feat_uri}" + end +end + def new_feature_dataset_uri(d) if URIS[d] and URIS[d][:new_feature_dataset_uri] URIS[d][:new_feature_dataset_uri] |