rdkit.VLib.NodeLib.SmilesOutput.OutputNode

Package rdkit :: Package VLib :: Package NodeLib :: Module SmilesOutput :: Class OutputNode |
[hide private]
[frames] | no frames]

# Class OutputNode

source code

       object --+
                |
    Node.VLibNode --+
                    |
    Output.OutputNode --+
                        |
                       OutputNode

    dumps smiles output

    Assumptions:

      - destination supports a write() method

      - inputs (parents) can be stepped through in lockstep

    Usage Example:
      >>> smis = ['C1CCC1','C1CC1','C=O','NCC']
      >>> mols = [Chem.MolFromSmiles(x) for x in smis]
      >>> from rdkit.VLib.Supply import SupplyNode
      >>> suppl = SupplyNode(contents=mols)
      >>> import StringIO
      >>> io = StringIO.StringIO()
      >>> node = OutputNode(dest=io,delim=', ')
      >>> node.AddParent(suppl)
      >>> ms = [x for x in node]
      >>> len(ms)
      4
      >>> txt = io.getvalue()
      >>> repr(txt)
      "'1, C1CCC1\\n2, C1CC1\\n3, C=O\\n4, CCN\\n'"

Instance Methods | [hide private]
__init__(self, dest=None, delim=`'``\t``'`, idField=None, **kwargs) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
reset(self) resets our iteration state | source code
smilesOut(self, mol) | source code
Inherited from `Output.OutputNode`: `next` Inherited from `Node.VLibNode`: `AddChild`, `AddParent`, `Destroy`, `GetChildren`, `GetParents`, `RemoveChild`, `RemoveParent`, `__iter__` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, dest=None, delim=`'``\t``'`, idField=None, **kwargs) (Constructor) | source code
    x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__ (inherited documentation)

### reset(self) | source code
    resets our iteration state
Overrides: Node.VLibNode.reset (inherited documentation)