| Trees | Indices | Help |
|
|---|
|
|
object --+
|
??.instance --+
|
SDMolSupplier
A class which supplies molecules from an SD file.
Usage examples:
1) Lazy evaluation: the molecules are not constructed until we ask for them:
>>> suppl = SDMolSupplier('in.smi')
>>> for mol in suppl:
... mol.GetNumAtoms()
2) Lazy evaluation 2:
>>> suppl = SDMolSupplier('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 = SDMolSupplier('in.smi')
>>> nMols = len(suppl)
>>> for i in range(nMols):
... suppl[i].GetNumAtoms()
Properties in the SD file are used to set properties on each molecule.
The properties are accessible using the mol.GetProp(propName) method.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
__instance_size__ = 48
|
|||
|
|||
|
Inherited from |
|||
|
|||
returns the text for an item
C++ signature:
GetItemText(RDKit::SDMolSupplier {lvalue} self, unsigned int index) -> std::string
|
Sets the text to be parsed
C++ signature:
SetData(RDKit::SDMolSupplier {lvalue} self, std::string data, bool sanitize=True, bool removeHs=True) -> void*
|
Sets the locations of mol beginnings in the input stream. Be *very* careful with this method.
C++ signature:
_SetStreamIndices(RDKit::SDMolSupplier {lvalue} self, boost::python::api::object locs) -> void*
|
C++ signature: __getitem__(RDKit::SDMolSupplier*, int) -> RDKit::ROMol* |
C++ signature:
__init__(_object*) -> void*
C++ signature:
__init__(_object*, std::string fileName, bool sanitize=True, bool removeHs=True) -> void*
|
C++ signature: __iter__(RDKit::SDMolSupplier*) -> RDKit::SDMolSupplier* |
C++ signature:
__len__(RDKit::SDMolSupplier {lvalue}) -> unsigned int
|
Returns the next molecule in the file. Raises _StopIteration_ on EOF.
C++ signature:
next(RDKit::SDMolSupplier*) -> RDKit::ROMol*
|
Resets our position in the file to the beginning.
C++ signature:
reset(RDKit::SDMolSupplier {lvalue}) -> void*
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Sat May 24 08:37:06 2008 | http://epydoc.sourceforge.net |