rdkit.Chem.rdfiltercatalog.FilterMatcherBase

Package rdkit :: Package Chem :: Module rdfiltercatalog :: Class FilterMatcherBase |
[hide private]
[frames] | no frames]

# Class FilterMatcherBase

     object --+
              |
    ??.instance --+
                  |
                 FilterMatcherBase

Known Subclasses:
  - ExclusionList
  - , FilterHierarchyMatcher
  - , PythonFilterMatcher
  - , SmartsMatcher

    Base class for matching molecules to filters.

     A FilterMatcherBase supplies the following API
     - IsValid() returns True if the matcher is valid for use, False otherwise
     - HasMatch(mol) returns True if the molecule matches the filter
     - GetMatches(mol) -> [FilterMatch, FilterMatch] returns all the FilterMatch data
           that matches the molecule

    print( FilterMatcherBase ) will print user-friendly information about the filter
    Note that a FilterMatcherBase can be combined from may FilterMatcherBases
    This is why GetMatches can return multiple FilterMatcherBases.
    >>> from rdkit.Chem.FilterCatalog import *
    >>> carbon_matcher = SmartsMatcher('Carbon', '[#6]', 0, 1)
    >>> oxygen_matcher = SmartsMatcher('Oxygen', '[#8]', 0, 1)
    >>> co_matcher = FilterMatchOps.Or(carbon_matcher, oxygen_matcher)
    >>> mol = Chem.MolFromSmiles('C')
    >>> matches = co_matcher.GetMatches(mol)
    >>> len(matches)
    1
    >>> print(matches[0].filterMatch)
    Carbon

Instance Methods | [hide private]
GetMatches(...) GetMatches( (FilterMatcherBase)arg1, (Mol)mol) -> VectFilterMatch : Returns the list of matching subfilters mol matches any filter |
GetName(...) GetName( (FilterMatcherBase)arg1) -> str : |
HasMatch(...) HasMatch( (FilterMatcherBase)arg1, (Mol)mol) -> bool : Returns True if mol matches the filter |
IsValid(...) IsValid( (FilterMatcherBase)arg1) -> bool : Return True if the filter matcher is valid, False otherwise |
__init__(...) Raises an exception... |
__reduce__(...) helper for pickle |
__str__(...) __str__( (FilterMatcherBase)arg1) -> str : |
Inherited from `unreachable.instance`: `__new__` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### GetMatches(...) |
    GetMatches( (FilterMatcherBase)arg1, (Mol)mol) -> VectFilterMatch :
        Returns the list of matching subfilters mol matches any filter

        C++ signature :
            std::vector<RDKit::FilterMatch, std::allocator<RDKit::FilterMatch> > GetMatches(RDKit::FilterMatcherBase {lvalue},RDKit::ROMol)

### GetName(...) |
    GetName( (FilterMatcherBase)arg1) -> str :

        C++ signature :
            std::string GetName(RDKit::FilterMatcherBase {lvalue})

### HasMatch(...) |
    HasMatch( (FilterMatcherBase)arg1, (Mol)mol) -> bool :
        Returns True if mol matches the filter

        C++ signature :
            bool HasMatch(RDKit::FilterMatcherBase {lvalue},RDKit::ROMol)

### IsValid(...) |
    IsValid( (FilterMatcherBase)arg1) -> bool :
        Return True if the filter matcher is valid, False otherwise

        C++ signature :
            bool IsValid(RDKit::FilterMatcherBase {lvalue})

### __init__(...) (Constructor) |
    Raises an exception
    This class cannot be instantiated from Python
Overrides: object.__init__

### __reduce__(...) |
    helper for pickle
Overrides: object.__reduce__ (inherited documentation)

### __str__(...) (Informal representation operator) |
    __str__( (FilterMatcherBase)arg1) -> str :

        C++ signature :
            std::string __str__(RDKit::FilterMatcherBase {lvalue})
Overrides: object.__str__