summaryrefslogtreecommitdiff
path: root/lib/compound.rb
diff options
context:
space:
mode:
authorist <ist@ist.opentox.org>2010-06-11 17:35:10 +0200
committerist <ist@ist.opentox.org>2010-06-11 17:35:10 +0200
commit4902d7d4c2d45ef98d20d5a6269e0dbf3bd01cc4 (patch)
treefd698132b92ed15cd709591d7ec428559d22dd8f /lib/compound.rb
parentaf7bf8b2845de787fb9d571054fb1ad3b6522dbf (diff)
Added occurrence function 'match_all'
Diffstat (limited to 'lib/compound.rb')
-rw-r--r--lib/compound.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compound.rb b/lib/compound.rb
index 6ab78e0..7c7c3d8 100644
--- a/lib/compound.rb
+++ b/lib/compound.rb
@@ -69,6 +69,12 @@ module OpenTox
smarts_array.collect{|s| s if match?(s)}.compact
end
+ # AM
+ # Match an array of smarts features, returns (0)1 for (non)matching features at each pos
+ def match_all(smarts_array)
+ smarts_array.collect{|s| match?(s) ? 1 : 0 }
+ end
+
def sdf2inchi(sdf)
obconversion(sdf,'sdf','inchi')
end