rdkit.Chem.rdfiltercatalog.SmartsMatcher

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

# Class SmartsMatcher

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

    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

Instance Methods | [hide private]
GetMaxCount(...) GetMaxCount( (SmartsMatcher)arg1) -> int : Get the maximum times pattern can appear for the filter to match |
GetMinCount(...) GetMinCount( (SmartsMatcher)arg1) -> int : Get the minimum times pattern must appear for the filter to match |
GetPattern(...) GetPattern( (SmartsMatcher)arg1) -> Mol : |
IsValid(...) IsValid( (SmartsMatcher)arg1) -> bool : Returns True if the SmartsMatcher is valid |
SetMaxCount(...) SetMaxCount( (SmartsMatcher)arg1, (int)count) -> None : Set the maximum times pattern can appear for the filter to match |
SetMinCount(...) SetMinCount( (SmartsMatcher)arg1, (int)count) -> None : Set the minimum times pattern must appear to match |
SetPattern(...) SetPattern( (SmartsMatcher)arg1, (Mol)arg2) -> None : Set the pattern molecule for the SmartsMatcher |
__init__(...) __init__( (object)arg1, (str)arg2) -> None : |
Inherited from `FilterMatcherBase`: `GetMatches`, `GetName`, `HasMatch`, `__reduce__`, `__str__` Inherited from `unreachable.instance`: `__new__` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Class Variables | [hide private]
| __instance_size__ = `24`

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

Method Details | [hide private]

### GetMaxCount(...) |
    GetMaxCount( (SmartsMatcher)arg1) -> int :
        Get the maximum times pattern can appear for the filter to match

        C++ signature :
            unsigned int GetMaxCount(RDKit::SmartsMatcher {lvalue})

### GetMinCount(...) |
    GetMinCount( (SmartsMatcher)arg1) -> int :
        Get the minimum times pattern must appear for the filter to match

        C++ signature :
            unsigned int GetMinCount(RDKit::SmartsMatcher {lvalue})

### GetPattern(...) |
    GetPattern( (SmartsMatcher)arg1) -> Mol :

        C++ signature :
            boost::shared_ptr<RDKit::ROMol> GetPattern(RDKit::SmartsMatcher {lvalue})

### IsValid(...) |
    IsValid( (SmartsMatcher)arg1) -> bool :
        Returns True if the SmartsMatcher is valid

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

### SetMaxCount(...) |
    SetMaxCount( (SmartsMatcher)arg1, (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(...) |
    SetMinCount( (SmartsMatcher)arg1, (int)count) -> None :
        Set the minimum times pattern must appear to match

        C++ signature :
            void SetMinCount(RDKit::SmartsMatcher {lvalue},unsigned int)

### SetPattern(...) |
    SetPattern( (SmartsMatcher)arg1, (Mol)arg2) -> None :
        Set the pattern molecule for the SmartsMatcher

        C++ signature :
            void SetPattern(RDKit::SmartsMatcher {lvalue},RDKit::ROMol)

    SetPattern( (SmartsMatcher)arg1, (str)arg2) -> None :
        Set the smarts pattern for the Smarts Matcher (warning: MinimumCount is not reset)

        C++ signature :
            void SetPattern(RDKit::SmartsMatcher {lvalue},std::string)

### __init__(...) (Constructor) |
    __init__( (object)arg1, (str)arg2) -> None :

        C++ signature :
            void __init__(_object*,std::string)

    __init__( (object)arg1, (Mol)arg2) -> None :
        Construct from a molecule

        C++ signature :
            void __init__(_object*,RDKit::ROMol)

    __init__( (object)arg1, (str)arg2, (Mol)arg3) -> None :
        Construct from a name and a molecule

        C++ signature :
            void __init__(_object*,std::string,RDKit::ROMol)

    __init__( (object)arg1, (str)arg2, (Mol)arg3, (int)arg4) -> None :
        Construct from a name, molecule and minimum count

        C++ signature :
            void __init__(_object*,std::string,RDKit::ROMol,unsigned int)

    __init__( (object)arg1, (str)arg2, (Mol)arg3, (int)arg4, (int)arg5) -> None :
        Construct from a name, molecule, minimum and maximum count

        C++ signature :
            void __init__(_object*,std::string,RDKit::ROMol,unsigned int,unsigned int)

    __init__( (object)arg1, (str)arg2, (str)arg3) -> None :
        Construct from a name and smarts pattern (minimum count defaults to 1

        C++ signature :
            void __init__(_object*,std::string,std::string)

    __init__( (object)arg1, (str)arg2, (str)arg3, (int)arg4) -> None :
        Construct from a name,smarts pattern and minimum count

        C++ signature :
            void __init__(_object*,std::string,std::string,unsigned int)

    __init__( (object)arg1, (str)arg2, (str)arg3, (int)arg4, (int)arg5) -> None :
        Construct from a name,smarts pattern, minimum and maximum count

        C++ signature :
            void __init__(_object*,std::string,std::string,unsigned int,unsigned int)
Overrides: object.__init__