From 9094fe09345263331e67dc35cdde819700e315e9 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Thu, 30 Oct 2014 14:04:21 +0100 Subject: add method to fetch descriptor values --- lib/algorithm.rb | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3 From 6abc5c61ac5f011957997b2fbefe5d80cd154e6a Mon Sep 17 00:00:00 2001 From: mguetlein Date: Thu, 30 Oct 2014 14:10:54 +0100 Subject: add option to filter out predictions from validation result according to confidence --- lib/validation.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) -- cgit v1.2.3