Package rdkit :: 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(...)
GetItemText( (TDTMolSupplier)self, (int)index) -> str : returns the text for an item
 
SetData(...)
SetData( (TDTMolSupplier)self, (str)data [, (str)nameRecord='' [, (int)confId2D=-1 [, (int)confId3D=-1 [, (bool)sanitize=True]]]]) -> None : Sets the text to be parsed
 
__getitem__(...)
__getitem__( (TDTMolSupplier)arg1, (int)arg2) -> Mol :
 
__init__(...)
__init__( (object)arg1) -> None :
 
__iter__(...)
__iter__( (TDTMolSupplier)arg1) -> TDTMolSupplier :
 
__len__(...)
__len__( (TDTMolSupplier)arg1) -> int :
 
__reduce__(...)
helper for pickle
 
next(...)
next( (TDTMolSupplier)arg1) -> Mol : Returns the next molecule in the file.
 
reset(...)
reset( (TDTMolSupplier)arg1) -> None : Resets our position in the file 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__ = 96
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

GetItemText(...)

 

GetItemText( (TDTMolSupplier)self, (int)index) -> str :
    returns the text for an item

    C++ signature :
        std::string GetItemText(RDKit::TDTMolSupplier {lvalue},unsigned int)

SetData(...)

 

SetData( (TDTMolSupplier)self, (str)data [, (str)nameRecord='' [, (int)confId2D=-1 [, (int)confId3D=-1 [, (bool)sanitize=True]]]]) -> None :
    Sets the text to be parsed

    C++ signature :
        void SetData(RDKit::TDTMolSupplier {lvalue},std::string [,std::string='' [,int=-1 [,int=-1 [,bool=True]]]])

__getitem__(...)
(Indexing operator)

 

__getitem__( (TDTMolSupplier)arg1, (int)arg2) -> Mol :

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

__init__(...)
(Constructor)

 

__init__( (object)arg1) -> None :

    C++ signature :
        void __init__(_object*)

__init__( (object)arg1, (str)fileName [, (str)nameRecord='' [, (int)confId2D=-1 [, (int)confId3D=-1 [, (bool)sanitize=True]]]]) -> None :

    C++ signature :
        void __init__(_object*,std::string [,std::string='' [,int=-1 [,int=-1 [,bool=True]]]])

Overrides: object.__init__

__iter__(...)

 

__iter__( (TDTMolSupplier)arg1) -> TDTMolSupplier :

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

__len__(...)
(Length operator)

 

__len__( (TDTMolSupplier)arg1) -> int :

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

__reduce__(...)

 
helper for pickle

Overrides: object.__reduce__
(inherited documentation)

next(...)

 

next( (TDTMolSupplier)arg1) -> Mol :
    Returns the next molecule in the file.  Raises _StopIteration_ on EOF.
    

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

reset(...)

 

reset( (TDTMolSupplier)arg1) -> None :
    Resets our position in the file to the beginning.
    

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