class FilterMatcherBase
object --+
|
??.instance --+
|
FilterMatcherBase
- Known Subclasses:
-
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
|
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 |
|
|
|
|
|
|
|
__str__(...)
__str__( (FilterMatcherBase)arg1) -> str : |
|
|
Inherited from unreachable.instance :
__new__
|
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( (FilterMatcherBase)arg1) -> str :
C++ signature :
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetName(RDKit::FilterMatcherBase {lvalue})
|
HasMatch( (FilterMatcherBase)arg1, (Mol)mol) -> bool :
Returns True if mol matches the filter
C++ signature :
bool HasMatch(RDKit::FilterMatcherBase {lvalue},RDKit::ROMol)
|
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__
|
- Overrides:
object.__reduce__
- (inherited documentation)
|
__str__(...)
(Informal representation operator)
|
|
__str__( (FilterMatcherBase)arg1) -> str :
C++ signature :
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __str__(RDKit::FilterMatcherBase {lvalue})
- Overrides:
object.__str__
|