From 4902d7d4c2d45ef98d20d5a6269e0dbf3bd01cc4 Mon Sep 17 00:00:00 2001 From: ist Date: Fri, 11 Jun 2010 17:35:10 +0200 Subject: Added occurrence function 'match_all' --- lib/compound.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/compound.rb') 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 -- cgit v1.2.3