diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/algorithm.rb | 9 | ||||
-rw-r--r-- | lib/compound.rb | 8 | ||||
-rw-r--r-- | lib/dataset.rb | 5 | ||||
-rw-r--r-- | lib/owl.rb | 2 |
4 files changed, 18 insertions, 6 deletions
diff --git a/lib/algorithm.rb b/lib/algorithm.rb index 7fe08fa..9918110 100644 --- a/lib/algorithm.rb +++ b/lib/algorithm.rb @@ -1,7 +1,7 @@ module OpenTox module Algorithm - class Fminer #< OpenTox + class Fminer include Owl def initialize @@ -20,7 +20,7 @@ module OpenTox end end - class Lazar #< OpenTox + class Lazar include Owl def initialize @@ -37,6 +37,11 @@ module OpenTox { :scope => "mandatory", :value => "feature_generation_uri" } } end + + def self.create_model(params) + @uri = RestClient.post File.join(@@config[:services]["opentox-algorithm"], "lazar"), :dataset_uri => params[:dataset_uri], :feature_uri => params[:feature_uri], :feature_generation_uri => File.join(@@config[:services]["opentox-algorithm"], "fminer") + end + end class Similarity diff --git a/lib/compound.rb b/lib/compound.rb index 9e1cee7..4385a7d 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -34,6 +34,14 @@ module OpenTox obconversion(@inchi,'inchi','sdf') end + def image + RestClient.get("#{@@cactus_uri}#{@inchi}/image") + end + + def image_uri + "#{@@cactus_uri}#{@inchi}/image" + end + # Matchs a smarts string def match?(smarts) obconversion = OpenBabel::OBConversion.new diff --git a/lib/dataset.rb b/lib/dataset.rb index 0e7df13..ad69038 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -86,10 +86,9 @@ module OpenTox def self.find(uri) begin - data = RestClient.get uri, :accept => 'application/rdf+xml' # check if the resource is available dataset = Dataset.new - dataset.rdf= data - + data = RestClient.get uri, :accept => 'application/rdf+xml' # check if the resource is available + dataset.rdf = data dataset rescue nil @@ -12,7 +12,7 @@ module OpenTox # read OT Ontology #@parser.parse_into_model(@model,"http://opentox.org/data/documents/development/RDF%20files/OpenToxOntology/at_download/file") - @parser.parse_string_into_model(@model,File.read(File.join(File.dirname(__FILE__),"opentox.owl")),'/') + #@parser.parse_string_into_model(@model,File.read(File.join(File.dirname(__FILE__),"opentox.owl")),'/') # reate an anonymous resource for metadata # this has to be rewritten with an URI as soon as the resource has been saved at an definitive location tmp = @model.create_resource |