diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-08-05 12:55:58 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-08-05 12:55:58 +0200 |
commit | b92d78620f7e9ed3a35730f867019723f51c4462 (patch) | |
tree | 1aab98345f8802edebdaf976748bf62f94aef641 /lib/compound.rb | |
parent | 34a7b50fb278fc37c937f2fe170b86332eb054c5 (diff) | |
parent | 9d2f25cdfc340bc7d9df7a041a5b23c1552c7d53 (diff) |
Merge commit 'mguetlein/test' into development
Conflicts:
lib/owl.rb
Diffstat (limited to 'lib/compound.rb')
-rw-r--r-- | lib/compound.rb | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/compound.rb b/lib/compound.rb index 9366db4..49c166f 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -52,13 +52,30 @@ module OpenTox end def png - RestClientWrapper.get("#{@@ambit_uri}#{smiles}") + RestClientWrapper.get(File.join @uri, "image") end + def names + begin + RestClientWrapper.get("#{@@cactus_uri}#{@inchi}/names") + rescue + "not available" + end + end + + def display_smarts_uri(activating, deactivating, highlight = nil) + LOGGER.debug activating.to_yaml unless activating.nil? + activating_smarts = URI.encode "\"#{activating.join("\"/\"")}\"" + deactivating_smarts = URI.encode "\"#{deactivating.join("\"/\"")}\"" + if highlight.nil? + File.join @@config[:services]["opentox-compound"], "smiles", URI.encode(smiles), "smarts/activating", URI.encode(activating_smarts),"deactivating", URI.encode(deactivating_smarts) + else + File.join @@config[:services]["opentox-compound"], "smiles", URI.encode(smiles), "smarts/activating", URI.encode(activating_smarts),"deactivating", URI.encode(deactivating_smarts), "highlight", URI.encode(highlight) + end + end + def image_uri File.join @uri, "image" - #"#{@@ambit_uri}#{smiles}" - #"#{@@cactus_uri}#{@inchi}/image" end # Matchs a smarts string |