diff options
author | rautenberg <rautenberg@in-silico.ch> | 2014-11-04 17:05:04 +0100 |
---|---|---|
committer | rautenberg <rautenberg@in-silico.ch> | 2014-11-04 17:05:04 +0100 |
commit | 589137fc4bd8ddeebaecad5a1e498048fb52046f (patch) | |
tree | 46414d97b7ba5c11251ee27510f18b17afc6f151 | |
parent | f6b7f7f812b29ccffb34fcf55d4cef7fbd8b2744 (diff) | |
parent | 321115e7176648227cfc8c56c995ce4e8721fbfb (diff) |
Merge branch 'development' of github.com:opentox/opentox-client into development
-rw-r--r-- | lib/algorithm.rb | 5 | ||||
-rw-r--r-- | lib/validation.rb | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/algorithm.rb b/lib/algorithm.rb index 582a1d1..bd4e54a 100644 --- a/lib/algorithm.rb +++ b/lib/algorithm.rb @@ -47,6 +47,11 @@ module OpenTox Hash[ RestClientWrapper.get(File.join(service_uri, "descriptor", "physchem", "list")).to_s.split("\n").collect{|l| l.split("\t")} ] end + # returns array of "descriptor-values", as CDK descriptors calculate serveral values, e.g., ALOGP produces ALOGP.ALogP, ALOGP.ALogp2, ALOGP.AMR + def self.physchem_descriptor_values + RestClientWrapper.get(File.join(service_uri, "descriptor", "physchem", "list_values")).to_s.split("\n") + end + end class Fminer diff --git a/lib/validation.rb b/lib/validation.rb index 997f814..18af2c2 100644 --- a/lib/validation.rb +++ b/lib/validation.rb @@ -116,6 +116,18 @@ module OpenTox table end + # filters the validation-predictions and returns validation-metadata with filtered statistics + # @param min_confidence [Float] predictions with confidence < min_confidence are filtered out + # @param min_num_predictions [Integer] optional, additional param to min_confidence, the top min_num_predictions are selected, even if confidence to low + # @param max_num_predictions [Integer] returns the top max_num_predictions (with the highest confidence), not compatible to min_confidence + # return [Hash] metadata + def filter_metadata( min_confidence, min_num_predictions=nil, max_num_predictions=nil ) + conf = min_confidence ? "min_confidence=#{min_confidence}" : nil + min = min_num_predictions ? "min_num_predictions=#{min_num_predictions}" : nil + max = max_num_predictions ? "max_num_predictions=#{max_num_predictions}" : nil + YAML.load(OpenTox::RestClientWrapper.get("#{@uri}?#{[conf,min,max].compact.join("&")}",nil,{:accept => "application/x-yaml"})) + end + # returns probability-distribution for a given prediction # it takes all predictions into account that have a confidence value that is >= confidence and that have the same predicted value # (minimum 12 predictions with the hightest confidence are selected (even if the confidence is lower than the given param) |