Package Chem :: Module rdchem :: Class Mol
[hide private]
[frames] | no frames]

Class Mol



 object --+    
          |    
??.instance --+
              |
             Mol

The Molecule class.

In addition to the expected Atoms and Bonds, molecules contain:
  - a collection of Atom and Bond bookmarks indexed with integers
      that can be used to flag and retrieve particular Atoms or Bonds
      using the {get|set}{Atom|Bond}Bookmark() methods.

  - a set of string-valued properties. These can have arbitrary string
      labels and can be set and retrieved using the {set|get}Prop() methods
      Molecular properties can be tagged as being *computed*, in which case
        they will be automatically cleared under certain circumstances (when the
        molecule itself is modified, for example).
      Molecules also have the concept of *private* properties, which are tagged
        by beginning the property name with an underscore (_).



Instance Methods [hide private]
 
AddConformer(...)
Add a conformer to the molecule and return the conformer ID...
 
ClearComputedProps(...)
Removes all computed properties from the molecule.
 
ClearProp(...)
Removes a property from the molecule.
 
Debug(...)
Prints debugging information about the molecule.
 
GetAtomWithIdx(...)
Returns a particular Atom.
 
GetAtoms(...)
Returns a read-only sequence containing all of the molecule's Atoms.
 
GetBondBetweenAtoms(...)
Returns the bond between two atoms, if there is one.
 
GetBondWithIdx(...)
Returns a particular Bond.
 
GetBonds(...)
Returns a read-only sequence containing all of the molecule's Bonds.
 
GetConformer(...)
Get the conformer with a specified ID...
 
GetConformers(...)
Get all the conformers as a tuple...
 
GetNumAtoms(...)
Returns the number of Atoms in the molecule.
 
GetNumBonds(...)
Returns the number of Bonds in the molecule.
 
GetNumConformers(...)
Return the number of conformations on the molecule...
 
GetProp(...)
Returns the value of the property.
 
GetPropNames(...)
Returns a tuple with all property names for this molecule.
 
GetRingInfo(...)
Returns the number of molecule's RingInfo object.
 
GetSubstructMatch(...)
Returns the indices of the molecule's atoms that match a substructure query.
 
GetSubstructMatches(...)
Returns tuples of the indices of the molecule's atoms that match a substructure query.
 
HasProp(...)
Queries a molecule to see if a particular property has been assigned.
 
HasSubstructMatch(...)
Queries whether or not the molecule contains a particular substructure.
 
RemoveAllConformers(...)
Remove all the conformations on the molecule...
 
RemoveConformer(...)
Remove the conformer with the specified ID...
 
SetProp(...)
Sets a molecular property ARGUMENTS: - key: the name of the property to be set (a string).
 
ToBinary(...)
Returns a binary string representation of the molecule.
 
UpdatePropertyCache(...)
Regenerates computed properties like implicit valence and ring information.
 
__getinitargs__(...)
C++ signature:...
 
__init__(...)
Constructor, takes no arguments...
 
__reduce__(...)
helper for pickle

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  __instance_size__ = 16
  __safe_for_unpickling__ = True
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

AddConformer(...)

 
Add a conformer to the molecule and return the conformer ID
C++ signature:
    AddConformer(RDKit::ROMol {lvalue} self, RDKit::Conformer* conf, bool assignId=False) -> unsigned int

ClearComputedProps(...)

 
Removes all computed properties from the molecule.


C++ signature:
    ClearComputedProps(RDKit::ROMol) -> void*

ClearProp(...)

 
Removes a property from the molecule.

  ARGUMENTS:
    - key: the name of the property to clear (a string).

  NOTE:
    - If the property has not been set, a KeyError exception will be raised.

C++ signature:
    ClearProp(RDKit::ROMol, char const*) -> void*

Debug(...)

 
Prints debugging information about the molecule.

C++ signature:
    Debug(RDKit::ROMol) -> void*

GetAtomWithIdx(...)

 
Returns a particular Atom.

  ARGUMENTS:
    - idx: which Atom to return

  NOTE: atom indices start at 0

C++ signature:
    GetAtomWithIdx(RDKit::ROMol {lvalue}, unsigned int) -> RDKit::Atom*

GetAtoms(...)

 
Returns a read-only sequence containing all of the molecule's Atoms.

C++ signature:
    GetAtoms(RDKit::ROMol*) -> RDKit::ReadOnlySeq<RDKit::AtomIterator_<RDKit::Atom, RDKit::ROMol, boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::property<RDKit::vertex_atom_t, RDKit::Atom*, boost::no_property>, boost::property<RDKit::edge_bond_t, RDKit::Bond*, boost::property<RDKit::edge_wght_t, double, boost::no_property> >, boost::no_property, boost::listS>, boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::property<RDKit::vertex_atom_t, RDKit::Atom*, boost::no_property>, boost::property<RDKit::edge_bond_t, RDKit::Bond*, boost::property<RDKit::edge_wght_t, double, boost::no_property> >, boost::no_property, boost::listS>*, RDKit::Atom*, RDKit::Atom*&, RDKit::vertex_atom_t> >, RDKit::Atom*>*

GetBondBetweenAtoms(...)

 
Returns the bond between two atoms, if there is one.

  ARGUMENTS:
    - idx1,idx2: the Atom indices

  Returns:
    The Bond between the two atoms, if such a bond exists.
    If there is no Bond between the atoms, None is returned instead.

  NOTE: bond indices start at 0

C++ signature:
    GetBondBetweenAtoms(RDKit::ROMol {lvalue}, unsigned int, unsigned int) -> RDKit::Bond*

GetBondWithIdx(...)

 
Returns a particular Bond.

  ARGUMENTS:
    - idx: which Bond to return

  NOTE: bond indices start at 0

C++ signature:
    GetBondWithIdx(RDKit::ROMol {lvalue}, unsigned int) -> RDKit::Bond*

GetBonds(...)

 
Returns a read-only sequence containing all of the molecule's Bonds.

C++ signature:
    GetBonds(RDKit::ROMol*) -> RDKit::ReadOnlySeq<RDKit::BondIterator_, RDKit::Bond*>*

GetConformer(...)

 
Get the conformer with a specified ID
C++ signature:
    GetConformer(RDKit::ROMol {lvalue} self, int id=-1) -> RDKit::Conformer*

GetConformers(...)

 
Get all the conformers as a tuple
C++ signature:
    GetConformers(RDKit::ROMol {lvalue}) -> _object*

GetNumAtoms(...)

 
Returns the number of Atoms in the molecule.

  ARGUMENTS:
    - onlyHeavy: (optional) include only heavy atoms (not Hs)
                 defaults to 1.

C++ signature:
    GetNumAtoms(RDKit::ROMol {lvalue}, bool onlyHeavy=True) -> unsigned int

GetNumBonds(...)

 
Returns the number of Bonds in the molecule.

  ARGUMENTS:
    - onlyHeavy: (optional) include only bonds to heavy atoms (not Hs)
                  defaults to 1.

C++ signature:
    GetNumBonds(RDKit::ROMol {lvalue}, bool onlyHeavy=True) -> unsigned int

GetNumConformers(...)

 
Return the number of conformations on the molecule
C++ signature:
    GetNumConformers(RDKit::ROMol {lvalue}) -> unsigned int

GetProp(...)

 
Returns the value of the property.

  ARGUMENTS:
    - key: the name of the property to return (a string).

  RETURNS: a string

  NOTE:
    - If the property has not been set, a KeyError exception will be raised.

C++ signature:
    GetProp(RDKit::ROMol, char const*) -> std::string

GetPropNames(...)

 
Returns a tuple with all property names for this molecule.

  ARGUMENTS:
    - includePrivate: (optional) toggles inclusion of private properties in the result set.
                      Defaults to 0.
    - includeComputed: (optional) toggles inclusion of computed properties in the result set.
                      Defaults to 0.

  RETURNS: a tuple of strings

C++ signature:
    GetPropNames(RDKit::ROMol self, bool includePrivate=False, bool includeComputed=False) -> std::vector<std::string, std::allocator<std::string> >

GetRingInfo(...)

 
Returns the number of molecule's RingInfo object.


C++ signature:
    GetRingInfo(RDKit::ROMol {lvalue}) -> RDKit::RingInfo*

GetSubstructMatch(...)

 
Returns the indices of the molecule's atoms that match a substructure query.

  ARGUMENTS:
    - query: a Molecule

    - useChirality: (optional)

  RETURNS: a tuple of integers

  NOTES:
     - only a single match is returned
     - the ordering of the indices corresponds to the atom ordering
         in the query. For example, the first index is for the atom in
         this molecule that matches the first atom in the query.

C++ signature:
    GetSubstructMatch(RDKit::ROMol self, RDKit::ROMol query, bool useChirality=False) -> _object*

GetSubstructMatches(...)

 
Returns tuples of the indices of the molecule's atoms that match a substructure query.

  ARGUMENTS:
    - query: a Molecule.
    - uniquify: (optional) determines whether or not the matches are uniquified.
                Defaults to 1.

    - useChirality: (optional)

  RETURNS: a tuple of tuples of integers

  NOTE:
     - the ordering of the indices corresponds to the atom ordering
         in the query. For example, the first index is for the atom in
         this molecule that matches the first atom in the query.

C++ signature:
    GetSubstructMatches(RDKit::ROMol self, RDKit::ROMol query, bool uniquify=True, bool useChirality=False) -> _object*

HasProp(...)

 
Queries a molecule to see if a particular property has been assigned.

  ARGUMENTS:
    - key: the name of the property to check for (a string).

C++ signature:
    HasProp(RDKit::ROMol, char const*) -> int

HasSubstructMatch(...)

 
Queries whether or not the molecule contains a particular substructure.

  ARGUMENTS:
    - query: a Molecule

    - recursionPossible: (optional)

    - useChirality: (optional)

  RETURNS: 1 or 0

C++ signature:
    HasSubstructMatch(RDKit::ROMol self, RDKit::ROMol query, bool recursionPossible=True, bool useChirality=False) -> bool

RemoveAllConformers(...)

 
Remove all the conformations on the molecule
C++ signature:
    RemoveAllConformers(RDKit::ROMol {lvalue}) -> void*

RemoveConformer(...)

 
Remove the conformer with the specified ID
C++ signature:
    RemoveConformer(RDKit::ROMol {lvalue}, unsigned int) -> void*

SetProp(...)

 
Sets a molecular property

  ARGUMENTS:
    - key: the name of the property to be set (a string).
    - value: the property value (a string).
    - computed: (optional) marks the property as being computed.
                Defaults to 0.


C++ signature:
    SetProp(RDKit::ROMol self, char const* key, std::string val, bool computed=False) -> void*

ToBinary(...)

 
Returns a binary string representation of the molecule.

C++ signature:
    ToBinary(RDKit::ROMol) -> std::string

UpdatePropertyCache(...)

 
Regenerates computed properties like implicit valence and ring information.


C++ signature:
    UpdatePropertyCache(RDKit::ROMol {lvalue} self, bool strict=True) -> void*

__getinitargs__(...)

 
C++ signature:
__getinitargs__(RDKit::ROMol) -> boost::python::tuple

__init__(...)
(Constructor)

 
Constructor, takes no arguments
C++ signature:
    __init__(_object*) -> void*
C++ signature:
    __init__(_object*, std::string) -> void*

Overrides: object.__init__

__reduce__(...)

 
helper for pickle

Overrides: object.__reduce__
(inherited documentation)