Package cinfony :: Module cdk :: Class Smarts
[frames] | no frames]

Class Smarts

source code

object --+
         |
        Smarts

A Smarts Pattern Matcher

Required parameters:
   smartspattern

Methods:
   findall()

Example:
>>> mol = readstring("smi","CCN(CC)CC") # triethylamine
>>> smarts = Smarts("[#6][#6]") # Matches an ethyl group
>>> print smarts.findall(mol)
[(1, 2), (4, 5), (6, 7)]

Instance Methods
 
__init__(self, smartspattern)
Initialise with a SMARTS pattern.
source code
 
findall(self, molecule)
Find all matches of the SMARTS pattern to a particular molecule.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, smartspattern)
(Constructor)

source code 

Initialise with a SMARTS pattern.

Overrides: object.__init__

findall(self, molecule)

source code 
Find all matches of the SMARTS pattern to a particular molecule.

Required parameters:
   molecule