Daylight v4.9
Release Date: 1 February 2008

Name

dt_origstream - retrieve a stream of objects ordered as they were created

Generic Prototype

dt_origstream(dt_Handle, dt_Integer) => dt_Handle

C Prototype

#include "dt_smiles.h"

dt_Handle dt_origstream(dt_Handle object, dt_Integer type)

FORTRAN Prototype

include 'dt_f_smiles.inc'

integer*4 dt_f_origstream(object, type)

integer*4 object
integer*4 type

Description

Allocates a stream of 'type', in original order, for the reaction or molecule 'object'. Calls to dt_next(3) over the new stream will return the constituent objects in the same order as their symbols appeared in the original string used to create the molecule or reaction via dt_smilin(3), or in the order in which the atoms, bonds, and molecules were added with dt_addatom(3), dt_addbond(3), dt_addcomponent(3).

For a molecule, TYP_ATOM and TYP_BOND are allowed. For a reaction, TYP_ATOM, TYP_BOND, and TYP_MOLECULE are allowed.

An origstream of atoms differs from other streams (dt_arbstream(3), dt_stream(3), dt_canstream(3)) in the handling of hydrogens. The origstream contains only the hydrogens explicitly shown in the input string or added as explicit atoms. If a hydrogen is suppressed during dt_smilin(3), the the special hydrogen dt_isohydro(3) is returned as a placeholder for the hydrogen in the origstream.

For example, performing dt_smilin(3) on the input SMILES [H][C]([H])([H])[H] would yield a molecule object in the toolkit with one atom. The function dt_stream(mol, TYP_ATOM) would return a stream with one atom, dt_count(mol, TYP_ATOM) would return one. A stream dt_origstream(mol, TYP_ATOM) would return a stream containing five objects: isohydro, carbon, isohydro, isohydro, isohydro. Similarly, an origstream of bonds would contain four isohydro atoms as placeholders for the bonds.

The stream is deallocated and its handle is revoked if the base molecule is modified or deallocated.

Return Value

Returns a new stream object or the NULL_OB if an error is encountered.

Related Topics

dt_addatom(3) dt_addbond(3) dt_addcomponent(3) dt_alloc_mol(3) dt_alloc_reaction(3) dt_arborder(3) dt_arbsmiles(3) dt_arbstream(3) dt_canstream(3) dt_cansmiles(3) dt_isohydro(3) dt_setarborder(3)