Package Chem :: Module rdmolfiles :: Class TDTMolSupplier
[hide private]
[frames] | no frames]

Class TDTMolSupplier



 object --+    
          |    
??.instance --+
              |
             TDTMolSupplier

A class which supplies molecules from a TDT file.

 Usage examples:

   1) Lazy evaluation: the molecules are not constructed until we ask for them:
      >>> suppl = TDTMolSupplier('in.smi')
      >>> for mol in suppl:
      ...    mol.GetNumAtoms()

   2) Lazy evaluation 2:
      >>> suppl = TDTMolSupplier('in.smi')
      >>> mol1 = suppl.next()
      >>> mol2 = suppl.next()
      >>> suppl.reset()
      >>> mol3 = suppl.next()
      # mol3 and mol1 are the same:        >>> MolToSmiles(mol3)==MolToSmiles(mol1)

   3) Random Access:  all molecules are constructed as soon as we ask for the
      length:
      >>> suppl = TDTMolSupplier('in.smi')
      >>> nMols = len(suppl)
      >>> for i in range(nMols):
      ...   suppl[i].GetNumAtoms()

 Properties in the file are used to set properties on each molecule.
The properties are accessible using the mol.GetProp(propName) method.



Instance Methods [hide private]
 
GetItemText(...)
returns the text for an item...
 
SetData(...)
Sets the text to be parsed...
 
__getitem__(...)
C++ signature:...
 
__init__(...)
C++ signature:...
 
__iter__(...)
C++ signature:...
 
__len__(...)
C++ signature:...
 
next(...)
Returns the next molecule in the file.
 
reset(...)
Resets our position in the file to the beginning.

Inherited from unreachable.instance: __new__

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

Class Variables [hide private]
  __instance_size__ = 64
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

GetItemText(...)

 
returns the text for an item
C++ signature:
    GetItemText(RDKit::TDTMolSupplier {lvalue} self, unsigned int index) -> std::string

SetData(...)

 
Sets the text to be parsed
C++ signature:
    SetData(RDKit::TDTMolSupplier {lvalue} self, std::string data, std::string nameRecord='', int confId2D=-1, int confId3D=-1, bool sanitize=True) -> void*

__getitem__(...)
(Indexing operator)

 
C++ signature:
__getitem__(RDKit::TDTMolSupplier*, int) -> RDKit::ROMol*

__init__(...)
(Constructor)

 
C++ signature:
    __init__(_object*) -> void*
C++ signature:
    __init__(_object*, std::string fileName, std::string nameRecord='', int confId2D=-1, int confId3D=-1, bool sanitize=True) -> void*

Overrides: object.__init__

__iter__(...)

 
C++ signature:
__iter__(RDKit::TDTMolSupplier*) -> RDKit::TDTMolSupplier*

__len__(...)
(Length operator)

 
C++ signature:
__len__(RDKit::TDTMolSupplier {lvalue}) -> unsigned int

next(...)

 
Returns the next molecule in the file.  Raises _StopIteration_ on EOF.

C++ signature:
    next(RDKit::TDTMolSupplier*) -> RDKit::ROMol*

reset(...)

 
Resets our position in the file to the beginning.

C++ signature:
    reset(RDKit::TDTMolSupplier {lvalue}) -> void*