Package schrodinger :: Package application :: Package desmond :: Package packages :: Package msys :: Class SmartsPattern
[hide private]
[frames] | no frames]

Class SmartsPattern

object --+
         |
        SmartsPattern

A class representing a compiled SMARTS pattern 

The Msys smarts implementation is similar to that of `Daylight smarts
<http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html>`, with
support for arbitrarily nested recursive smarts.  A few features are 
not currently supported; warnings will be generated when these constructs
are used in a smarts pattern.

* Directional bonds; e.g. ``\`` and `/`; these are treated as single bonds
  (i.e. as a `-` character).

* Chiral specification (``@``, ``@@``, etc); ignored.

* Implicit hydrogen (``h``): treated as explicit ``H``.

* Explicit degree (``D``): treated as bond count ``X``.

* Isotopes: (``[12C]``): ignored.

* Atom class (``[C:6]``): ignored.

On the other hand, Msys does support hybridization using the ``^`` token,
as in OpenBabel::

    [c^2]       select sp2 aromatic carbon

Instance Methods [hide private]
 
__init__(self, pattern)
Initialize with SMARTS pattern
 
__repr__(self)
repr(x)
 
findMatches(self, annotated_system, atoms=None)
Return list of lists representing ids of matches of this pattern in this system, optionally requiring that the first atom match belongs to the given set of atoms.
 
match(self, annotated_system)
Return True if a match is found anywhere; False otherwise.

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

Properties [hide private]
  natoms
Number of atoms in the compiled smarts pattern
  pattern
The pattern used to initialize the object
  warnings
Warnings, if any, emitted during compilation

Inherited from object: __class__

Method Details [hide private]

__init__(self, pattern)
(Constructor)

 

Initialize with SMARTS pattern

Overrides: object.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

findMatches(self, annotated_system, atoms=None)

 

Return list of lists representing ids of matches of this pattern in this system, optionally requiring that the first atom match belongs to the given set of atoms. An AnnotatedSystem must be used here, which can be constructed from a System after calling AssignBondOrderAndFormalCharge.

match(self, annotated_system)

 

Return True if a match is found anywhere; False otherwise.

This is much faster than checking for an empty result from findMatches.


Property Details [hide private]

natoms

Number of atoms in the compiled smarts pattern

Get Method:
unreachable.natoms(self) - Number of atoms in the compiled smarts pattern

pattern

The pattern used to initialize the object

Get Method:
unreachable.pattern(self) - The pattern used to initialize the object

warnings

Warnings, if any, emitted during compilation

Get Method:
unreachable.warnings(self) - Warnings, if any, emitted during compilation