| Trees | Indices | Help |
|
|---|
|
|
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.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
__instance_size__ = 120
|
|||
|
|||
GetItemText( (TDTMolSupplier)self, (int)index) -> str :
returns the text for an item
C++ signature :
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > GetItemText(RDKit::TDTMolSupplier {lvalue},unsigned int)
|
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::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >='' [,int=-1 [,int=-1 [,bool=True]]]])
|
__getitem__( (TDTMolSupplier)arg1, (int)arg2) -> Mol :
C++ signature :
RDKit::ROMol* __getitem__(RDKit::TDTMolSupplier*,int)
|
__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::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >='' [,int=-1 [,int=-1 [,bool=True]]]])
|
__iter__( (TDTMolSupplier)arg1) -> TDTMolSupplier :
C++ signature :
RDKit::TDTMolSupplier* __iter__(RDKit::TDTMolSupplier*)
|
__len__( (TDTMolSupplier)arg1) -> int :
C++ signature :
unsigned int __len__(RDKit::TDTMolSupplier {lvalue})
|
|
next( (TDTMolSupplier)arg1) -> Mol :
Returns the next molecule in the file. Raises _StopIteration_ on EOF.
C++ signature :
RDKit::ROMol* next(RDKit::TDTMolSupplier*)
|
reset( (TDTMolSupplier)arg1) -> None :
Resets our position in the file to the beginning.
C++ signature :
void reset(RDKit::TDTMolSupplier {lvalue})
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |