rdkit.Chem.rdfiltercatalog module¶
- class rdkit.Chem.rdfiltercatalog.ExclusionList((object)self)¶
Bases:
FilterMatcherBase
- C++ signature :
void __init__(_object*)
- AddPattern((ExclusionList)self, (FilterMatcherBase)base) None : ¶
Add a FilterMatcherBase that should not appear in a molecule
- C++ signature :
void AddPattern(RDKit::ExclusionList {lvalue},RDKit::FilterMatcherBase)
- SetExclusionPatterns((ExclusionList)self, (AtomPairsParameters)list) None : ¶
Set a list of FilterMatcherBases that should not appear in a molecule
- C++ signature :
void SetExclusionPatterns(RDKit::ExclusionList {lvalue},boost::python::api::object)
- class rdkit.Chem.rdfiltercatalog.FilterCatalog((object)self)¶
Bases:
instance
- C++ signature :
void __init__(_object*)
__init__( (object)self, (str)binStr) -> None :
- C++ signature :
void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
__init__( (object)self, (FilterCatalogParams)params) -> None :
- C++ signature :
void __init__(_object*,RDKit::FilterCatalogParams)
__init__( (object)self, (FilterCatalogs)catalogs) -> None :
- C++ signature :
void __init__(_object*,RDKit::FilterCatalogParams::FilterCatalogs)
- AddEntry((FilterCatalog)entry[, (FilterCatalogEntry)updateFPLength=False]) None : ¶
Add a FilterCatalogEntry to the catalog
- C++ signature :
void AddEntry(RDKit::FilterCatalog {lvalue} [,RDKit::FilterCatalogEntry*=False])
- GetEntry((FilterCatalog)self, (int)idx) FilterCatalogEntry : ¶
Return the FilterCatalogEntry at the specified index
- C++ signature :
boost::shared_ptr<RDKit::FilterCatalogEntry const> GetEntry(RDKit::FilterCatalog {lvalue},unsigned int)
- GetEntryWithIdx((FilterCatalog)self, (int)idx) FilterCatalogEntry : ¶
Return the FilterCatalogEntry at the specified index
- C++ signature :
boost::shared_ptr<RDKit::FilterCatalogEntry const> GetEntryWithIdx(RDKit::FilterCatalog {lvalue},unsigned int)
- GetFilterMatches((FilterCatalog)self, (Mol)mol) VectFilterMatch : ¶
Return every matching filter from all catalog entries that match mol
- C++ signature :
std::vector<RDKit::FilterMatch, std::allocator<RDKit::FilterMatch> > GetFilterMatches(RDKit::FilterCatalog {lvalue},RDKit::ROMol)
- GetFirstMatch((FilterCatalog)self, (Mol)mol) FilterCatalogEntry : ¶
Return the first catalog entry that matches mol
- C++ signature :
boost::shared_ptr<RDKit::FilterCatalogEntry const> GetFirstMatch(RDKit::FilterCatalog {lvalue},RDKit::ROMol)
- GetMatches((FilterCatalog)self, (Mol)mol) FilterCatalogEntryList : ¶
Return all catalog entries that match mol
- C++ signature :
std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > > GetMatches(RDKit::FilterCatalog {lvalue},RDKit::ROMol)
- GetNumEntries((FilterCatalog)self) int : ¶
Returns the number of entries in the catalog
- C++ signature :
unsigned int GetNumEntries(RDKit::FilterCatalog {lvalue})
- HasMatch((FilterCatalog)self, (Mol)mol) bool : ¶
Returns True if the catalog has an entry that matches mol
- C++ signature :
bool HasMatch(RDKit::FilterCatalog {lvalue},RDKit::ROMol)
- RemoveEntry((FilterCatalog)self, (AtomPairsParameters)obj) bool : ¶
Remove the given entry from the catalog
- C++ signature :
bool RemoveEntry(RDKit::FilterCatalog {lvalue},boost::python::api::object)
- Serialize((FilterCatalog)self) object : ¶
- C++ signature :
boost::python::api::object Serialize(RDKit::FilterCatalog)
- rdkit.Chem.rdfiltercatalog.FilterCatalogCanSerialize() bool : ¶
Returns True if the FilterCatalog is serializable (requires boost serialization
- C++ signature :
bool FilterCatalogCanSerialize()
- class rdkit.Chem.rdfiltercatalog.FilterCatalogEntry¶
Bases:
instance
A filter catalog entry is an entry in a filter catalog. Each filter is named and is used to flag a molecule usually for some undesirable property.
For example, a PAINS (Pan Assay INterference) catalog entry be appear as follows:
>>> from rdkit.Chem.FilterCatalog import * >>> params = FilterCatalogParams() >>> params.AddCatalog(FilterCatalogParams.FilterCatalogs.PAINS_A) True >>> catalog = FilterCatalog(params) >>> mol = Chem.MolFromSmiles('O=C(Cn1cnc2c1c(=O)n(C)c(=O)n2C)N/N=C/c1c(O)ccc2c1cccc2') >>> entry = catalog.GetFirstMatch(mol) >>> print (entry.GetProp('Scope')) PAINS filters (family A) >>> print (entry.GetDescription()) hzone_phenol_A(479)
__init__( (object)self) -> None :
- C++ signature :
void __init__(_object*)
__init__( (object)self, (str)name, (FilterMatcherBase)matcher) -> None :
- C++ signature :
void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,RDKit::FilterMatcherBase {lvalue})
- ClearProp((FilterCatalogEntry)self, (str)key) None : ¶
- C++ signature :
void ClearProp(RDKit::FilterCatalogEntry {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
- GetDescription((FilterCatalogEntry)self) str : ¶
Get the description of the catalog entry
- C++ signature :
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetDescription(RDKit::FilterCatalogEntry {lvalue})
- GetFilterMatches((FilterCatalogEntry)self, (Mol)mol) VectFilterMatch : ¶
Retrieve the list of filters that match the molecule
- C++ signature :
std::vector<RDKit::FilterMatch, std::allocator<RDKit::FilterMatch> > GetFilterMatches(RDKit::FilterCatalogEntry {lvalue},RDKit::ROMol)
- GetProp((FilterCatalogEntry)self, (str)key) str : ¶
- C++ signature :
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetProp(RDKit::FilterCatalogEntry {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
- GetPropList((FilterCatalogEntry)self) _vectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE : ¶
- C++ signature :
std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > GetPropList(RDKit::FilterCatalogEntry {lvalue})
- HasFilterMatch((FilterCatalogEntry)self, (Mol)mol) bool : ¶
Returns True if the catalog entry contains filters that match the molecule
- C++ signature :
bool HasFilterMatch(RDKit::FilterCatalogEntry {lvalue},RDKit::ROMol)
- IsValid((FilterCatalogEntry)self) bool : ¶
- C++ signature :
bool IsValid(RDKit::FilterCatalogEntry {lvalue})
- Serialize((FilterCatalogEntry)self) object : ¶
- C++ signature :
boost::python::api::object Serialize(RDKit::FilterCatalogEntry)
- SetDescription((FilterCatalogEntry)self, (str)description) None : ¶
Set the description of the catalog entry
- C++ signature :
void SetDescription(RDKit::FilterCatalogEntry {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
- SetProp((FilterCatalogEntry)self, (str)key, (str)val) None : ¶
- C++ signature :
void SetProp(RDKit::FilterCatalogEntry {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
- class rdkit.Chem.rdfiltercatalog.FilterCatalogEntryList((object)arg1)¶
Bases:
instance
- C++ signature :
void __init__(_object*)
- append((FilterCatalogEntryList)arg1, (AtomPairsParameters)arg2) None : ¶
- C++ signature :
void append(std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > > {lvalue},boost::python::api::object)
- extend((FilterCatalogEntryList)arg1, (AtomPairsParameters)arg2) None : ¶
- C++ signature :
void extend(std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > > {lvalue},boost::python::api::object)
- class rdkit.Chem.rdfiltercatalog.FilterCatalogListOfEntryList((object)arg1)¶
Bases:
instance
- C++ signature :
void __init__(_object*)
- append((FilterCatalogListOfEntryList)arg1, (AtomPairsParameters)arg2) None : ¶
- C++ signature :
void append(std::vector<std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > >, std::allocator<std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > > > > {lvalue},boost::python::api::object)
- extend((FilterCatalogListOfEntryList)arg1, (AtomPairsParameters)arg2) None : ¶
- C++ signature :
void extend(std::vector<std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > >, std::allocator<std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > > > > {lvalue},boost::python::api::object)
- class rdkit.Chem.rdfiltercatalog.FilterCatalogParams((object)self)¶
Bases:
instance
- C++ signature :
void __init__(_object*)
- __init__( (object)self, (FilterCatalogs)catalogs) -> None :
Construct from a FilterCatalogs identifier (i.e. FilterCatalogParams.PAINS)
- C++ signature :
void __init__(_object*,RDKit::FilterCatalogParams::FilterCatalogs)
- AddCatalog((FilterCatalogParams)self, (FilterCatalogs)catalogs) bool : ¶
- C++ signature :
bool AddCatalog(RDKit::FilterCatalogParams {lvalue},RDKit::FilterCatalogParams::FilterCatalogs)
- class FilterCatalogs¶
Bases:
enum
- ALL = rdkit.Chem.rdfiltercatalog.FilterCatalogs.ALL¶
- BRENK = rdkit.Chem.rdfiltercatalog.FilterCatalogs.BRENK¶
- CHEMBL = rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL¶
- CHEMBL_BMS = rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_BMS¶
- CHEMBL_Dundee = rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Dundee¶
- CHEMBL_Glaxo = rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Glaxo¶
- CHEMBL_Inpharmatica = rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Inpharmatica¶
- CHEMBL_LINT = rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_LINT¶
- CHEMBL_MLSMR = rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_MLSMR¶
- CHEMBL_SureChEMBL = rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_SureChEMBL¶
- NIH = rdkit.Chem.rdfiltercatalog.FilterCatalogs.NIH¶
- PAINS = rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS¶
- PAINS_A = rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_A¶
- PAINS_B = rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_B¶
- PAINS_C = rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_C¶
- ZINC = rdkit.Chem.rdfiltercatalog.FilterCatalogs.ZINC¶
- names = {'ALL': rdkit.Chem.rdfiltercatalog.FilterCatalogs.ALL, 'BRENK': rdkit.Chem.rdfiltercatalog.FilterCatalogs.BRENK, 'CHEMBL': rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL, 'CHEMBL_BMS': rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_BMS, 'CHEMBL_Dundee': rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Dundee, 'CHEMBL_Glaxo': rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Glaxo, 'CHEMBL_Inpharmatica': rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Inpharmatica, 'CHEMBL_LINT': rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_LINT, 'CHEMBL_MLSMR': rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_MLSMR, 'CHEMBL_SureChEMBL': rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_SureChEMBL, 'NIH': rdkit.Chem.rdfiltercatalog.FilterCatalogs.NIH, 'PAINS': rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS, 'PAINS_A': rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_A, 'PAINS_B': rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_B, 'PAINS_C': rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_C, 'ZINC': rdkit.Chem.rdfiltercatalog.FilterCatalogs.ZINC}¶
- values = {2: rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_A, 4: rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_B, 8: rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS_C, 14: rdkit.Chem.rdfiltercatalog.FilterCatalogs.PAINS, 16: rdkit.Chem.rdfiltercatalog.FilterCatalogs.BRENK, 32: rdkit.Chem.rdfiltercatalog.FilterCatalogs.NIH, 64: rdkit.Chem.rdfiltercatalog.FilterCatalogs.ZINC, 128: rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Glaxo, 256: rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Dundee, 512: rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_BMS, 1024: rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_SureChEMBL, 2048: rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_MLSMR, 4096: rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_Inpharmatica, 8192: rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL_LINT, 16256: rdkit.Chem.rdfiltercatalog.FilterCatalogs.CHEMBL, 16382: rdkit.Chem.rdfiltercatalog.FilterCatalogs.ALL}¶
- class rdkit.Chem.rdfiltercatalog.FilterHierarchyMatcher((object)self)¶
Bases:
FilterMatcherBase
- Hierarchical Filter
- basic constructors:
FilterHierarchyMatcher( matcher ) where can be any FilterMatcherBase (SmartsMatcher, etc)
- FilterHierarchyMatcher’s have children and can form matching
trees. then GetFilterMatches is called, the most specific ( i.e. lowest node in a branch) is returned.
- n.b. A FilterHierarchicalMatcher of functional groups is returned
by calling GetFunctionalGroupHierarchy()
>>> from rdkit.Chem import MolFromSmiles >>> from rdkit.Chem.FilterCatalog import * >>> functionalGroups = GetFunctionalGroupHierarchy() >>> [match.filterMatch.GetName() ... for match in functionalGroups.GetFilterMatches( ... MolFromSmiles('c1ccccc1Cl'))] ['Halogen.Aromatic', 'Halogen.NotFluorine.Aromatic']
- C++ signature :
void __init__(_object*)
- __init__( (object)self, (FilterMatcherBase)matcher) -> None :
Construct from a filtermatcher
- C++ signature :
void __init__(_object*,RDKit::FilterMatcherBase)
- AddChild((FilterHierarchyMatcher)self, (FilterHierarchyMatcher)hierarchy) FilterHierarchyMatcher : ¶
Add a child node to this hierarchy.
- C++ signature :
boost::shared_ptr<RDKit::FilterHierarchyMatcher> AddChild(RDKit::FilterHierarchyMatcher {lvalue},RDKit::FilterHierarchyMatcher)
- SetPattern((FilterHierarchyMatcher)self, (FilterMatcherBase)matcher) None : ¶
Set the filtermatcher pattern for this node. An empty node is considered a root node and passes along the matches to the children.
- C++ signature :
void SetPattern(RDKit::FilterHierarchyMatcher {lvalue},RDKit::FilterMatcherBase)
- class rdkit.Chem.rdfiltercatalog.FilterMatch((object)self, (FilterMatcherBase)filter, (MatchTypeVect)atomPairs)¶
Bases:
instance
Object that holds the result of running FilterMatcherBase::GetMatches
filterMatch holds the FilterMatchBase that triggered the match
atomParis holds the [ (query_atom_idx, target_atom_idx) ] pairs for the matches.
Note that some matches may not have atom pairs (especially matches that use FilterMatchOps.Not
- C++ signature :
void __init__(_object*,boost::shared_ptr<RDKit::FilterMatcherBase>,std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >)
- property atomPairs¶
- property filterMatch¶
- class rdkit.Chem.rdfiltercatalog.FilterMatcherBase¶
Bases:
instance
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
Raises an exception This class cannot be instantiated from Python
- GetMatches((FilterMatcherBase)self, (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)self) str : ¶
- C++ signature :
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetName(RDKit::FilterMatcherBase {lvalue})
- HasMatch((FilterMatcherBase)self, (Mol)mol) bool : ¶
Returns True if mol matches the filter
- C++ signature :
bool HasMatch(RDKit::FilterMatcherBase {lvalue},RDKit::ROMol)
- IsValid((FilterMatcherBase)self) bool : ¶
Return True if the filter matcher is valid, False otherwise
- C++ signature :
bool IsValid(RDKit::FilterMatcherBase {lvalue})
- rdkit.Chem.rdfiltercatalog.GetFlattenedFunctionalGroupHierarchy([(bool)normalized=False]) dict : ¶
Returns the flattened functional group hierarchy as a dictionary of name:ROMOL_SPTR substructure items
- C++ signature :
boost::python::dict GetFlattenedFunctionalGroupHierarchy([ bool=False])
- rdkit.Chem.rdfiltercatalog.GetFunctionalGroupHierarchy() FilterCatalog : ¶
Returns the functional group hierarchy filter catalog
- C++ signature :
RDKit::FilterCatalog GetFunctionalGroupHierarchy()
- class rdkit.Chem.rdfiltercatalog.IntPair((object)arg1)¶
Bases:
instance
- C++ signature :
void __init__(_object*)
__init__( (object)self, (int)query, (int)target) -> None :
- C++ signature :
void __init__(_object*,int,int)
- property query¶
- property target¶
- class rdkit.Chem.rdfiltercatalog.MolList((object)arg1)¶
Bases:
instance
- C++ signature :
void __init__(_object*)
- append((MolList)arg1, (AtomPairsParameters)arg2) None : ¶
- C++ signature :
void append(std::vector<RDKit::ROMol*, std::allocator<RDKit::ROMol*> > {lvalue},boost::python::api::object)
- extend((MolList)arg1, (AtomPairsParameters)arg2) None : ¶
- C++ signature :
void extend(std::vector<RDKit::ROMol*, std::allocator<RDKit::ROMol*> > {lvalue},boost::python::api::object)
- class rdkit.Chem.rdfiltercatalog.PythonFilterMatcher((object)self, (object)callback)¶
Bases:
FilterMatcherBase
- C++ signature :
void __init__(_object*,_object*)
- rdkit.Chem.rdfiltercatalog.RunFilterCatalog((FilterCatalog)filterCatalog, (_vectNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE)smiles[, (int)numThreads=1]) FilterCatalogListOfEntryList : ¶
Run the filter catalog on the input list of smiles strings. Use numThreads=0 to use all available processors. Returns a vector of vectors. For each input smiles, a vector of FilterCatalogEntry objects are returned for each matched filter. If a molecule matches no filter, the vector will be empty. If a smiles string can’t be parsed, a ‘Bad smiles’ entry is returned.
- C++ signature :
std::vector<std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > >, std::allocator<std::vector<boost::shared_ptr<RDKit::FilterCatalogEntry const>, std::allocator<boost::shared_ptr<RDKit::FilterCatalogEntry const> > > > > RunFilterCatalog(RDKit::FilterCatalog,std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > [,int=1])
- class rdkit.Chem.rdfiltercatalog.SmartsMatcher((object)self, (str)name)¶
Bases:
FilterMatcherBase
- Smarts Matcher Filter
- basic constructors:
SmartsMatcher( name, smarts_pattern, minCount=1, maxCount=UINT_MAX ) SmartsMatcher( name, molecule, minCount=1, maxCount=UINT_MAX )
- note: If the supplied smarts pattern is not valid, the IsValid() function will
return False
>>> from rdkit.Chem.FilterCatalog import * >>> minCount, maxCount = 1,2 >>> carbon_matcher = SmartsMatcher('Carbon', '[#6]', minCount, maxCount) >>> print (carbon_matcher.HasMatch(Chem.MolFromSmiles('CC'))) True >>> print (carbon_matcher.HasMatch(Chem.MolFromSmiles('CCC'))) False >>> carbon_matcher.SetMinCount(2) >>> print (carbon_matcher.HasMatch(Chem.MolFromSmiles('C'))) False >>> carbon_matcher.SetMaxCount(3) >>> print (carbon_matcher.HasMatch(Chem.MolFromSmiles('CCC'))) True
- C++ signature :
void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
- __init__( (object)self, (Mol)rhs) -> None :
Construct from a molecule
- C++ signature :
void __init__(_object*,RDKit::ROMol)
- __init__( (object)self, (str)name, (Mol)mol [, (int)minCount=1 [, (int)maxCount=4294967295]]) -> None :
Construct from a name, molecule, minimum and maximum count
- C++ signature :
void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,RDKit::ROMol [,unsigned int=1 [,unsigned int=4294967295]])
- __init__( (object)self, (str)name, (str)smarts [, (int)minCount=1 [, (int)maxCount=4294967295]]) -> None :
Construct from a name,smarts pattern, minimum and maximum count
- C++ signature :
void __init__(_object*,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,unsigned int=1 [,unsigned int=4294967295]])
- GetMaxCount((SmartsMatcher)self) int : ¶
Get the maximum times pattern can appear for the filter to match
- C++ signature :
unsigned int GetMaxCount(RDKit::SmartsMatcher {lvalue})
- GetMinCount((SmartsMatcher)self) int : ¶
Get the minimum times pattern must appear for the filter to match
- C++ signature :
unsigned int GetMinCount(RDKit::SmartsMatcher {lvalue})
- GetPattern((SmartsMatcher)self) Mol : ¶
- C++ signature :
boost::shared_ptr<RDKit::ROMol> GetPattern(RDKit::SmartsMatcher {lvalue})
- IsValid((SmartsMatcher)self) bool : ¶
Returns True if the SmartsMatcher is valid
- C++ signature :
bool IsValid(RDKit::SmartsMatcher {lvalue})
- SetMaxCount((SmartsMatcher)self, (int)count) None : ¶
Set the maximum times pattern can appear for the filter to match
- C++ signature :
void SetMaxCount(RDKit::SmartsMatcher {lvalue},unsigned int)
- SetMinCount((SmartsMatcher)self, (int)count) None : ¶
Set the minimum times pattern must appear to match
- C++ signature :
void SetMinCount(RDKit::SmartsMatcher {lvalue},unsigned int)
- SetPattern((SmartsMatcher)self, (Mol)pat) None : ¶
Set the pattern molecule for the SmartsMatcher
- C++ signature :
void SetPattern(RDKit::SmartsMatcher {lvalue},RDKit::ROMol)
- SetPattern( (SmartsMatcher)self, (str)pat) -> None :
Set the smarts pattern for the Smarts Matcher (warning: MinimumCount is not reset)
- C++ signature :
void SetPattern(RDKit::SmartsMatcher {lvalue},std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
- class rdkit.Chem.rdfiltercatalog.VectFilterMatch((object)arg1)¶
Bases:
instance
- C++ signature :
void __init__(_object*)
- append((VectFilterMatch)arg1, (AtomPairsParameters)arg2) None : ¶
- C++ signature :
void append(std::vector<RDKit::FilterMatch, std::allocator<RDKit::FilterMatch> > {lvalue},boost::python::api::object)
- extend((VectFilterMatch)arg1, (AtomPairsParameters)arg2) None : ¶
- C++ signature :
void extend(std::vector<RDKit::FilterMatch, std::allocator<RDKit::FilterMatch> > {lvalue},boost::python::api::object)