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

Class ForwardSDMolSupplier

 object --+    
          |    
??.instance --+
              |
             ForwardSDMolSupplier

A class which supplies molecules from file-like object containing SD data.

Usage examples:

  1) Lazy evaluation: the molecules are not constructed until we ask for them:
     >>> suppl = ForwardSDMolSupplier(file('in.sdf'))
     >>> for mol in suppl:
     ...    if mol is not None: mol.GetNumAtoms()

  2) we can also read from compressed files: 
     >>> import gzip
     >>> suppl = ForwardSDMolSupplier(gzip.open('in.sdf.gz'))
     >>> for mol in suppl:
      ...   if mol is not None: print mol.GetNumAtoms()

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

Instance Methods [hide private]
 
__init__(...)
__init__( (object)arg1, (AtomPairsParameters)fileobj [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> None :
 
__iter__(...)
__iter__( (ForwardSDMolSupplier)arg1) -> ForwardSDMolSupplier :
 
__reduce__(...)
helper for pickle
 
atEnd(...)
atEnd( (ForwardSDMolSupplier)arg1) -> bool : Returns whether or not we have hit EOF.
 
next(...)
next( (ForwardSDMolSupplier)arg1) -> Mol : Returns the next molecule in the file.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

__init__( (object)arg1, (AtomPairsParameters)fileobj [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> None :

    C++ signature :
        void __init__(_object*,boost::python::api::object {lvalue} [,bool=True [,bool=True [,bool=True]]])

__init__( (object)arg1, (streambuf)streambuf [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> None :

    C++ signature :
        void __init__(_object*,boost_adaptbx::python::streambuf {lvalue} [,bool=True [,bool=True [,bool=True]]])

__init__( (object)arg1, (str)filename [, (bool)sanitize=True [, (bool)removeHs=True [, (bool)strictParsing=True]]]) -> None :

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

Overrides: object.__init__

__iter__(...)

 

__iter__( (ForwardSDMolSupplier)arg1) -> ForwardSDMolSupplier :

    C++ signature :
        (anonymous namespace)::LocalForwardSDMolSupplier* __iter__((anonymous namespace)::LocalForwardSDMolSupplier*)

__reduce__(...)

 
helper for pickle

Overrides: object.__reduce__
(inherited documentation)

atEnd(...)

 

atEnd( (ForwardSDMolSupplier)arg1) -> bool :
    Returns whether or not we have hit EOF.
    

    C++ signature :
        bool atEnd((anonymous namespace)::LocalForwardSDMolSupplier {lvalue})

next(...)

 

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

    C++ signature :
        RDKit::ROMol* next((anonymous namespace)::LocalForwardSDMolSupplier*)