Class RDFReader
Reader for RDF reaction files.
OEChem supposedly supports reading these already, in terms of listing
out all of the molecules from the reactions, but it loses important information.
- It misses the very first molecule of the first reaction completely,
- It doesn't keep the reaction components together, so it's unclear
where one reaction begins and another ends, as well as
being unclear whether each molecule encountered is a reactant or product.
- Data annotations applied to the reaction as a whole are missed.
Given an RDF file as text input, will generate an iterator over
the reactions in the file with a single composite reaction molecule
object representing each reaction, not each component. Furthermore,
each of these "reaction molecules" will include all of the relevant
annotations as SD data pairs.
Probably don't need to instantiate this directly, use reactionmolistream instead,
which takes a filename and figures out whether to use this wrapper or just
a standard oemolistream based on the filename extension.
|
__init__(self,
inputFile)
Initialization constructor, taking the text input file stream to
read from. |
|
|
|
__iter__(self)
Primary method, produce an iterator over the reaction contents of
the file. |
|
|
|
GetOEGraphMols(self)
Mirrors the OEChem oemolistream interface. |
|
|
|
close(self)
Mirrors the OEChem oemolistream interface. |
|
|
|
TAG_PREFIX = '$'
|
|
REACTION_BEGIN_TAG = '$RXN'
|
|
MOLECULE_BEGIN_TAG = '$MOL'
|
|
MOLECULE_END_TAG = 'M END'
|
|
REACTANT_PRODUCT_COUNT_LINE = 4
|
|
ANNOTATION_NAME_TAG = '$DTYPE'
|
|
ANNOTATION_VALUE_TAG = '$DATUM'
|
|
ANNOTATION_MOL_TAG = '$MFMT'
|
|
ANNOTATION_SMI_TAG = '$SMI'
|
|
ANNOTATION_WRAP_COLUMN = 80
|
|
ANNOTATION_WRAP_CHAR = '+'
|
|
inputFile = <CHEM.DB.rdb.search.NameRxnPatternMatchingModel.Se...
|
applyReactionRole(mol,
reactionRole)
Static Method
|
|
Convenience method. Set all of the atoms in the molecule as belonging
to the respective reaction role (i.e., reactant, reagent, product).
|