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(...)
AddConformer( (Mol)self, (Conformer)conf [, (bool)assignId=False]) -> int :...
 
ClearComputedProps(...)
ClearComputedProps( (Mol)arg1) -> None : Removes all computed properties from the molecule.
 
ClearProp(...)
ClearProp( (Mol)arg1, (str)arg2) -> None : Removes a property from the molecule.
 
Debug(...)
Debug( (Mol)arg1) -> None : Prints debugging information about the molecule.
 
GetAtomWithIdx(...)
GetAtomWithIdx( (Mol)arg1, (int)arg2) -> Atom : Returns a particular Atom.
 
GetAtoms(...)
GetAtoms( (Mol)arg1) -> _ROAtomSeq : Returns a read-only sequence containing all of the molecule's Atoms.
 
GetBondBetweenAtoms(...)
GetBondBetweenAtoms( (Mol)arg1, (int)arg2, (int)arg3) -> Bond : Returns the bond between two atoms, if there is one.
 
GetBondWithIdx(...)
GetBondWithIdx( (Mol)arg1, (int)arg2) -> Bond : Returns a particular Bond.
 
GetBonds(...)
GetBonds( (Mol)arg1) -> _ROBondSeq : Returns a read-only sequence containing all of the molecule's Bonds.
 
GetConformer(...)
GetConformer( (Mol)self [, (int)id=-1]) -> Conformer :...
 
GetConformers(...)
GetConformers( (Mol)arg1) -> object :...
 
GetNumAtoms(...)
GetNumAtoms( (Mol)arg1 [, (bool)onlyHeavy=True]) -> int : Returns the number of Atoms in the molecule.
 
GetNumBonds(...)
GetNumBonds( (Mol)arg1 [, (bool)onlyHeavy=True]) -> int : Returns the number of Bonds in the molecule.
 
GetNumConformers(...)
GetNumConformers( (Mol)arg1) -> int :...
 
GetProp(...)
GetProp( (Mol)arg1, (str)arg2) -> str : Returns the value of the property.
 
GetPropNames(...)
GetPropNames( (Mol)self [, (bool)includePrivate=False [, (bool)includeComputed=False]]) -> _vectSs : Returns a tuple with all property names for this molecule.
 
GetRingInfo(...)
GetRingInfo( (Mol)arg1) -> RingInfo : Returns the number of molecule's RingInfo object.
 
GetSubstructMatch(...)
GetSubstructMatch( (Mol)self, (Mol)query [, (bool)useChirality=False]) -> object : Returns the indices of the molecule's atoms that match a substructure query.
 
GetSubstructMatches(...)
GetSubstructMatches( (Mol)self, (Mol)query [, (bool)uniquify=True [, (bool)useChirality=False]]) -> object : Returns tuples of the indices of the molecule's atoms that match a substructure query.
 
HasProp(...)
HasProp( (Mol)arg1, (str)arg2) -> int : Queries a molecule to see if a particular property has been assigned.
 
HasSubstructMatch(...)
HasSubstructMatch( (Mol)self, (Mol)query [, (bool)recursionPossible=True [, (bool)useChirality=False]]) -> bool : Queries whether or not the molecule contains a particular substructure.
 
RemoveAllConformers(...)
RemoveAllConformers( (Mol)arg1) -> None :...
 
RemoveConformer(...)
RemoveConformer( (Mol)arg1, (int)arg2) -> None :...
 
SetProp(...)
SetProp( (Mol)self, (str)key, (str)val [, (bool)computed=False]) -> None : Sets a molecular property ARGUMENTS: - key: the name of the property to be set (a string).
 
ToBinary(...)
ToBinary( (Mol)arg1) -> str : Returns a binary string representation of the molecule.
 
UpdatePropertyCache(...)
UpdatePropertyCache( (Mol)self [, (bool)strict=True]) -> None : Regenerates computed properties like implicit valence and ring information.
 
__getinitargs__(...)
__getinitargs__( (Mol)arg1) -> tuple :...
 
__init__(...)
__init__( (object)arg1) -> None :...
 
__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(...)

 

AddConformer( (Mol)self, (Conformer)conf [, (bool)assignId=False]) -> int :
    Add a conformer to the molecule and return the conformer ID

    C++ signature :
        unsigned int AddConformer(RDKit::ROMol {lvalue},RDKit::Conformer* [,bool=False])

ClearComputedProps(...)

 

ClearComputedProps( (Mol)arg1) -> None :
    Removes all computed properties from the molecule.
    
    

    C++ signature :
        void ClearComputedProps(RDKit::ROMol)

ClearProp(...)

 

ClearProp( (Mol)arg1, (str)arg2) -> None :
    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 :
        void ClearProp(RDKit::ROMol,char const*)

Debug(...)

 

Debug( (Mol)arg1) -> None :
    Prints debugging information about the molecule.
    

    C++ signature :
        void Debug(RDKit::ROMol)

GetAtomWithIdx(...)

 

GetAtomWithIdx( (Mol)arg1, (int)arg2) -> Atom :
    Returns a particular Atom.
    
      ARGUMENTS:
        - idx: which Atom to return
    
      NOTE: atom indices start at 0
    

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

GetAtoms(...)

 

GetAtoms( (Mol)arg1) -> _ROAtomSeq :
    Returns a read-only sequence containing all of the molecule's Atoms.
    

    C++ signature :
        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*>* GetAtoms(RDKit::ROMol*)

GetBondBetweenAtoms(...)

 

GetBondBetweenAtoms( (Mol)arg1, (int)arg2, (int)arg3) -> Bond :
    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 :
        RDKit::Bond* GetBondBetweenAtoms(RDKit::ROMol {lvalue},unsigned int,unsigned int)

GetBondWithIdx(...)

 

GetBondWithIdx( (Mol)arg1, (int)arg2) -> Bond :
    Returns a particular Bond.
    
      ARGUMENTS:
        - idx: which Bond to return
    
      NOTE: bond indices start at 0
    

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

GetBonds(...)

 

GetBonds( (Mol)arg1) -> _ROBondSeq :
    Returns a read-only sequence containing all of the molecule's Bonds.
    

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

GetConformer(...)

 

GetConformer( (Mol)self [, (int)id=-1]) -> Conformer :
    Get the conformer with a specified ID

    C++ signature :
        RDKit::Conformer* GetConformer(RDKit::ROMol {lvalue} [,int=-1])

GetConformers(...)

 

GetConformers( (Mol)arg1) -> object :
    Get all the conformers as a tuple

    C++ signature :
        _object* GetConformers(RDKit::ROMol {lvalue})

GetNumAtoms(...)

 

GetNumAtoms( (Mol)arg1 [, (bool)onlyHeavy=True]) -> int :
    Returns the number of Atoms in the molecule.
    
      ARGUMENTS:
        - onlyHeavy: (optional) include only heavy atoms (not Hs)
                     defaults to 1.
    

    C++ signature :
        unsigned int GetNumAtoms(RDKit::ROMol {lvalue} [,bool=True])

GetNumBonds(...)

 

GetNumBonds( (Mol)arg1 [, (bool)onlyHeavy=True]) -> int :
    Returns the number of Bonds in the molecule.
    
      ARGUMENTS:
        - onlyHeavy: (optional) include only bonds to heavy atoms (not Hs)
                      defaults to 1.
    

    C++ signature :
        unsigned int GetNumBonds(RDKit::ROMol {lvalue} [,bool=True])

GetNumConformers(...)

 

GetNumConformers( (Mol)arg1) -> int :
    Return the number of conformations on the molecule

    C++ signature :
        unsigned int GetNumConformers(RDKit::ROMol {lvalue})

GetProp(...)

 

GetProp( (Mol)arg1, (str)arg2) -> str :
    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 :
        std::string GetProp(RDKit::ROMol,char const*)

GetPropNames(...)

 

GetPropNames( (Mol)self [, (bool)includePrivate=False [, (bool)includeComputed=False]]) -> _vectSs :
    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 :
        std::vector<std::string, std::allocator<std::string> > GetPropNames(RDKit::ROMol {lvalue} [,bool=False [,bool=False]])

GetRingInfo(...)

 

GetRingInfo( (Mol)arg1) -> RingInfo :
    Returns the number of molecule's RingInfo object.
    
    

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

GetSubstructMatch(...)

 

GetSubstructMatch( (Mol)self, (Mol)query [, (bool)useChirality=False]) -> object :
    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 :
        _object* GetSubstructMatch(RDKit::ROMol,RDKit::ROMol [,bool=False])

GetSubstructMatches(...)

 

GetSubstructMatches( (Mol)self, (Mol)query [, (bool)uniquify=True [, (bool)useChirality=False]]) -> object :
    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 :
        _object* GetSubstructMatches(RDKit::ROMol,RDKit::ROMol [,bool=True [,bool=False]])

HasProp(...)

 

HasProp( (Mol)arg1, (str)arg2) -> int :
    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 :
        int HasProp(RDKit::ROMol,char const*)

HasSubstructMatch(...)

 

HasSubstructMatch( (Mol)self, (Mol)query [, (bool)recursionPossible=True [, (bool)useChirality=False]]) -> bool :
    Queries whether or not the molecule contains a particular substructure.
    
      ARGUMENTS:
        - query: a Molecule
    
        - recursionPossible: (optional)
    
        - useChirality: (optional)
    
      RETURNS: 1 or 0
    

    C++ signature :
        bool HasSubstructMatch(RDKit::ROMol,RDKit::ROMol [,bool=True [,bool=False]])

RemoveAllConformers(...)

 

RemoveAllConformers( (Mol)arg1) -> None :
    Remove all the conformations on the molecule

    C++ signature :
        void RemoveAllConformers(RDKit::ROMol {lvalue})

RemoveConformer(...)

 

RemoveConformer( (Mol)arg1, (int)arg2) -> None :
    Remove the conformer with the specified ID

    C++ signature :
        void RemoveConformer(RDKit::ROMol {lvalue},unsigned int)

SetProp(...)

 

SetProp( (Mol)self, (str)key, (str)val [, (bool)computed=False]) -> None :
    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 :
        void SetProp(RDKit::ROMol,char const*,std::string [,bool=False])

ToBinary(...)

 

ToBinary( (Mol)arg1) -> str :
    Returns a binary string representation of the molecule.
    

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

UpdatePropertyCache(...)

 

UpdatePropertyCache( (Mol)self [, (bool)strict=True]) -> None :
    Regenerates computed properties like implicit valence and ring information.
    
    

    C++ signature :
        void UpdatePropertyCache(RDKit::ROMol {lvalue} [,bool=True])

__getinitargs__(...)

 

__getinitargs__( (Mol)arg1) -> tuple :

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

__init__(...)
(Constructor)

 

__init__( (object)arg1) -> None :
    Constructor, takes no arguments

    C++ signature :
        void __init__(_object*)

__init__( (object)arg1, (str)arg2) -> None :

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

Overrides: object.__init__

__reduce__(...)

 
helper for pickle

Overrides: object.__reduce__
(inherited documentation)