diff options
author | Christoph Helma <helma@in-silico.ch> | 2011-03-10 12:01:20 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2011-03-10 12:01:20 +0100 |
commit | 127f26d09e3ad8710269e577549d9b58e1759fcf (patch) | |
tree | 41d6e1115839c1fecaf18ae4c2582f627bf7004e | |
parent | 4e30a6feca55e9de10c5013632593455b93f6e23 (diff) | |
parent | 64a18744fa1b8e58d008c28d9223969ac9b61e4b (diff) |
Merge branch 'release/v1.0.0'v1.0.0
-rw-r--r-- | README | 18 | ||||
-rw-r--r-- | lazar.rb | 26 |
2 files changed, 26 insertions, 18 deletions
@@ -6,7 +6,8 @@ OpenTox Algorithm - fminer - lazar -REST operations: +REST operations +--------------- Get a list of all algorithms GET / - URIs of algorithms 200 Get a representation of the GET /fminer - fminer representation 200,404 @@ -19,11 +20,13 @@ Create lazar model POST /lazar dataset_uri, URI for laza prediction_feature, feature_generation_uri -Supported MIME formats (http://chemical-mime.sourceforge.net/): +Supported MIME formats (http://chemical-mime.sourceforge.net/) +-------------------------------------------------------------- * application/rdf+xml (default): read/write OWL-DL -Examples: +Examples +-------- Get the OWL-DL representation of fminer curl http://webservices.in-silico.ch/algorithm/fminer @@ -33,7 +36,7 @@ Get the OWL-DL representation of lazar Create fminer features curl -X POST -d dataset_uri={datset_uri} -d prediction_feature={feature_uri} http://webservices.in-silico.ch/algorithm/fminer - (feaure_uri specifies the dependent variable, e.g. http://www.epa.gov/NCCT/dsstox/CentralFieldDef.html#ActivityOutcome_CPDBAS_Hamster) + (feature_uri specifies the dependent variable, e.g. http://www.epa.gov/NCCT/dsstox/CentralFieldDef.html#ActivityOutcome_CPDBAS_Hamster) Creates a dataset with fminer features (backbone refinement class representatives from supervised graph mining, see http://www.maunz.de/libfminer-doc/). These features can be used e.g. as structural alerts, as descriptors (fingerprints) for prediction models or for similarity calculations. @@ -41,7 +44,10 @@ Create lazar model curl -X POST -d dataset_uri={datset_uri} -d prediction_feature={feature_uri} -d feature_generation_uri=http://webservices.in-silico.ch/algorithm/fminer http://webservices.in-silico.ch/test/algorithm/lazar (feaure_uri specifies the dependent variable, e.g. http://www.epa.gov/NCCT/dsstox/CentralFieldDef.html#ActivityOutcome_CPDBAS_Hamster) -More documentation: Source code (application.rb, fminer.rb, lazar.rb) +API documentation +----------------- + +http://rdoc.info/github/opentox/algorithm -Copyright (c) 2009 Christoph Helma. See LICENSE for details. +Copyright (c) 2009-2011 Christoph Helma, Martin Guetlein, Micha Rautenberg, Andreas Maunz, David Vorgrimmler, Denis Gebele. See LICENSE for details. @@ -113,18 +113,20 @@ post '/lazar/?' do end lazar.activities[compound] = [] unless lazar.activities[compound] - training_activities.data_entries[compound][params[:prediction_feature]].each do |value| - case value.to_s - when "true" - lazar.activities[compound] << true - when "false" - lazar.activities[compound] << false - else - halt 404, "0 values not allowed in training dataset. log10 is calculated internally." if value.to_f == 0 - lazar.activities[compound] << value.to_f - lazar.prediction_algorithm = "Neighbors.local_svm_regression" - end - end + unless training_activities.data_entries[compound][params[:prediction_feature]].empty? + training_activities.data_entries[compound][params[:prediction_feature]].each do |value| + case value.to_s + when "true" + lazar.activities[compound] << true + when "false" + lazar.activities[compound] << false + else + halt 404, "0 values not allowed in training dataset. log10 is calculated internally." if value.to_f == 0 + lazar.activities[compound] << value.to_f + lazar.prediction_algorithm = "Neighbors.local_svm_regression" + end + end + end end lazar.metadata[DC.title] = "lazar model for #{URI.decode(File.basename(prediction_feature))}" |