Class: Chem::OpenBabel::OBSmarts
- Inherits:
-
Object
- Object
- Chem::OpenBabel::OBSmarts
- Defined in:
- lib/chem/utils/openbabel.rb
Instance Method Summary collapse
- #get_umap_list ⇒ Object
-
#initialize(smarts) ⇒ OBSmarts
constructor
A new instance of OBSmarts.
- #match(mol) ⇒ Object
Constructor Details
#initialize(smarts) ⇒ OBSmarts
Returns a new instance of OBSmarts.
90 91 92 93 94 95 |
# File 'lib/chem/utils/openbabel.rb', line 90 def initialize(smarts) require 'openbabel' @pat = ::OpenBabel::OBSmartsPattern.new @pat.init(smarts) @pat end |
Instance Method Details
#get_umap_list ⇒ Object
102 103 104 |
# File 'lib/chem/utils/openbabel.rb', line 102 def get_umap_list @pat.get_umap_list.collect{|ary| ary.collect{|i| i.to_i}} end |
#match(mol) ⇒ Object
97 98 99 100 |
# File 'lib/chem/utils/openbabel.rb', line 97 def match(mol) mol.use_open_babel if mol.ob_mol.nil? @pat.match(mol.ob_mol) end |