rdkit.Chem.rdchem.ResonanceMolSupplier

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

# Class ResonanceMolSupplier

     object --+
              |
    ??.instance --+
                  |
                 ResonanceMolSupplier

    A class which supplies resonance structures (as mols) from a mol.

    Usage examples:

      1) Lazy evaluation: the resonance structures are not constructed
         until we ask for them:
         >>> suppl = ResonanceMolSupplier(mol)
         >>> for resMol in suppl:
         ...    resMol.GetNumAtoms()

      2) Lazy evaluation 2:
         >>> suppl = ResonanceMolSupplier(mol)
         >>> resMol1 = suppl.next()
         >>> resMol2 = suppl.next()
         >>> suppl.reset()
         >>> resMol3 = suppl.next()
         # resMol3 and resMol1 are the same:
         >>> MolToSmiles(resMol3)==MolToSmiles(resMol1)

      3) Random Access:
         >>> suppl = ResonanceMolSupplier(mol)
         >>> resMol1 = suppl[0]
         >>> resMol2 = suppl[1]
         NOTE: this will generate an IndexError if the supplier doesn't have that many
         molecules.

      4) Random Access 2: looping over all resonance structures
         >>> suppl = ResonanceMolSupplier(mol)
         >>> nResMols = len(suppl)
         >>> for i in range(nResMols):
         ...   suppl[i].GetNumAtoms()

Instance Methods | [hide private]
Enumerate(...) Enumerate( (ResonanceMolSupplier)arg1) -> None : Ask ResonanceMolSupplier to enumerate resonance structures(automatically done as soon as any attempt to access them is made) |
GetAtomConjGrpIdx(...) GetAtomConjGrpIdx( (ResonanceMolSupplier)arg1, (int)arg2) -> int : Given an atom index, it returns the index of the conjugated groupthe atom belongs to, or -1 if it is not conjugated |
GetBondConjGrpIdx(...) GetBondConjGrpIdx( (ResonanceMolSupplier)arg1, (int)arg2) -> int : Given a bond index, it returns the index of the conjugated groupthe bond belongs to, or -1 if it is not conjugated |
GetIsEnumerated(...) GetIsEnumerated( (ResonanceMolSupplier)arg1) -> bool : Returns true if resonance structure enumeration has already happened |
GetNumConjGrps(...) GetNumConjGrps( (ResonanceMolSupplier)arg1) -> int : Returns the number of individual conjugated groups in the molecule |
GetSubstructMatch(...) GetSubstructMatch( (ResonanceMolSupplier)self, (Mol)query [, (bool)useChirality=False [, (bool)useQueryQueryMatches=False]]) -> object : Returns the indices of the molecule's atoms that match a substructure query, taking into account all resonance structures in ResonanceMolSupplier. |
GetSubstructMatches(...) GetSubstructMatches( (ResonanceMolSupplier)self, (Mol)query [, (bool)uniquify=False [, (bool)useChirality=False [, (bool)useQueryQueryMatches=False [, (int)maxMatches=1000 [, (int)numThreads=1]]]]]) -> object : Returns tuples of the indices of the molecule's atoms that match a substructure query, taking into account all resonance structures in ResonanceMolSupplier. |
SetNumThreads(...) SetNumThreads( (ResonanceMolSupplier)arg1, (int)arg2) -> None : Sets the number of threads to be used to enumerate resonance structures (defaults to 1; 0 selects the number of concurrent threads supported by the hardware; negative values are added to the number of concurrent threads supported by the hardware) |
__getitem__(...) __getitem__( (ResonanceMolSupplier)arg1, (int)arg2) -> Mol : |
__init__(...) __init__( (object)arg1, (Mol)mol [, (int)flags=0 [, (int)maxStructs=1000]]) -> None : |
__iter__(...) __iter__( (ResonanceMolSupplier)arg1) -> ResonanceMolSupplier : |
__len__(...) __len__( (ResonanceMolSupplier)arg1) -> int : |
__reduce__(...) helper for pickle |
atEnd(...) atEnd( (ResonanceMolSupplier)arg1) -> bool : Returns whether or not we have hit the end of the resonance structure supplier. |
next(...) next( (ResonanceMolSupplier)arg1) -> Mol : Returns the next resonance structure in the supplier. |
reset(...) reset( (ResonanceMolSupplier)arg1) -> None : Resets our position in the resonance structure supplier to the beginning. |
Inherited from `unreachable.instance`: `__new__` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

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

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

Method Details | [hide private]

### Enumerate(...) |
    Enumerate( (ResonanceMolSupplier)arg1) -> None :
        Ask ResonanceMolSupplier to enumerate resonance structures(automatically done as soon as any attempt to access them is made)

        C++ signature :
            void Enumerate(RDKit::ResonanceMolSupplier {lvalue})

### GetAtomConjGrpIdx(...) |
    GetAtomConjGrpIdx( (ResonanceMolSupplier)arg1, (int)arg2) -> int :
        Given an atom index, it returns the index of the conjugated groupthe atom belongs to, or -1 if it is not conjugated

        C++ signature :
            unsigned int GetAtomConjGrpIdx(RDKit::ResonanceMolSupplier {lvalue},unsigned int)

### GetBondConjGrpIdx(...) |
    GetBondConjGrpIdx( (ResonanceMolSupplier)arg1, (int)arg2) -> int :
        Given a bond index, it returns the index of the conjugated groupthe bond belongs to, or -1 if it is not conjugated

        C++ signature :
            unsigned int GetBondConjGrpIdx(RDKit::ResonanceMolSupplier {lvalue},unsigned int)

### GetIsEnumerated(...) |
    GetIsEnumerated( (ResonanceMolSupplier)arg1) -> bool :
        Returns true if resonance structure enumeration has already happened

        C++ signature :
            bool GetIsEnumerated(RDKit::ResonanceMolSupplier {lvalue})

### GetNumConjGrps(...) |
    GetNumConjGrps( (ResonanceMolSupplier)arg1) -> int :
        Returns the number of individual conjugated groups in the molecule

        C++ signature :
            unsigned int GetNumConjGrps(RDKit::ResonanceMolSupplier {lvalue})

### GetSubstructMatch(...) |
    GetSubstructMatch( (ResonanceMolSupplier)self, (Mol)query [, (bool)useChirality=False [, (bool)useQueryQueryMatches=False]]) -> object :
        Returns the indices of the molecule's atoms that match a substructure query,
        taking into account all resonance structures in ResonanceMolSupplier.

          ARGUMENTS:
            - query: a Molecule

            - useChirality: enables the use of stereochemistry in the matching

            - useQueryQueryMatches: use query-query matching logic

          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::ResonanceMolSupplier {lvalue},RDKit::ROMol [,bool=False [,bool=False]])

### GetSubstructMatches(...) |
    GetSubstructMatches( (ResonanceMolSupplier)self, (Mol)query [, (bool)uniquify=False [, (bool)useChirality=False [, (bool)useQueryQueryMatches=False [, (int)maxMatches=1000 [, (int)numThreads=1]]]]]) -> object :
        Returns tuples of the indices of the molecule's atoms that match a substructure query,
        taking into account all resonance structures in ResonanceMolSupplier.

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

            - useChirality: enables the use of stereochemistry in the matching

            - useQueryQueryMatches: use query-query matching logic

            - maxMatches: The maximum number of matches that will be returned.
                          In high-symmetry cases with medium-sized molecules, it is
                          very easy to end up with a combinatorial explosion in the
                          number of possible matches. This argument prevents that from
                          having unintended consequences

            - numThreads: The number of threads to be used (defaults to 1; 0 selects the
                          number of concurrent threads supported by the hardware; negative
                          values are added to the number of concurrent threads supported
                          by the hardware).

          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::ResonanceMolSupplier {lvalue},RDKit::ROMol [,bool=False [,bool=False [,bool=False [,unsigned int=1000 [,int=1]]]]])

### SetNumThreads(...) |
    SetNumThreads( (ResonanceMolSupplier)arg1, (int)arg2) -> None :
        Sets the number of threads to be used to enumerate resonance
        structures (defaults to 1; 0 selects the number of concurrent
        threads supported by the hardware; negative values are added
        to the number of concurrent threads supported by the hardware)

        C++ signature :
            void SetNumThreads(RDKit::ResonanceMolSupplier {lvalue},unsigned int)

### __getitem__(...) (Indexing operator) |
    __getitem__( (ResonanceMolSupplier)arg1, (int)arg2) -> Mol :

        C++ signature :
            RDKit::ROMol* __getitem__(RDKit::ResonanceMolSupplier*,int)

### __init__(...) (Constructor) |
    __init__( (object)arg1, (Mol)mol [, (int)flags=0 [, (int)maxStructs=1000]]) -> None :

        C++ signature :
            void __init__(_object*,RDKit::ROMol {lvalue} [,unsigned int=0 [,unsigned int=1000]])
Overrides: object.__init__

### __iter__(...) |
    __iter__( (ResonanceMolSupplier)arg1) -> ResonanceMolSupplier :

        C++ signature :
            RDKit::ResonanceMolSupplier* __iter__(RDKit::ResonanceMolSupplier*)

### __len__(...) (Length operator) |
    __len__( (ResonanceMolSupplier)arg1) -> int :

        C++ signature :
            unsigned int __len__(RDKit::ResonanceMolSupplier {lvalue})

### __reduce__(...) |
    helper for pickle
Overrides: object.__reduce__ (inherited documentation)

### atEnd(...) |
    atEnd( (ResonanceMolSupplier)arg1) -> bool :
        Returns whether or not we have hit the end of the resonance structure supplier.

        C++ signature :
            bool atEnd(RDKit::ResonanceMolSupplier {lvalue})

### next(...) |
    next( (ResonanceMolSupplier)arg1) -> Mol :
        Returns the next resonance structure in the supplier. Raises _StopIteration_ on end.

        C++ signature :
            RDKit::ROMol* next(RDKit::ResonanceMolSupplier*)

### reset(...) |
    reset( (ResonanceMolSupplier)arg1) -> None :
        Resets our position in the resonance structure supplier to the beginning.

        C++ signature :
            void reset(RDKit::ResonanceMolSupplier {lvalue})