# MDL Reaction Depiction¶

OEDepict TK also supports MDL reaction depiction. The reaction being depicted has to be imported by calling the OEReadMDLReactionQueryFile function. The rest of the process is identical to depicting a molecule. First the OEPrepareDepiction function has to be called to generate the 2D atom coordinates, then the image can be created by rendering the imported reaction (OERenderMolecule) (See examples in Figure: Example of MDL reaction depiction)

Listing 1: Example of reaction depiction

        if (args.Length != 2)
{
OEChem.OEThrow.Usage("DepictMDLReaction <mdlreaction> <imagefile>");
}
oemolistream ifs = new oemolistream(args[0]);
OEGraphMol qmol = new OEGraphMol();
OEDepict.OEPrepareDepiction(qmol);
OEDepict.OERenderMolecule(args[1], qmol);


Example of MDL reaction depiction

The atom map information read from the reaction file can be depicted as atom properties by using the OEDisplayAtomMapIdx class. (See examples in Figure: Example of MDL reaction depiction with atom mapping)

Listing 2: Example of reaction depiction with map indices

        if (args.Length != 2)
{
OEChem.OEThrow.Usage("DepictMDLReactionMapIdx <mdlreaction> <imagefile>");
}

string ifile =args[0];
string ofile = args[1];

oemolistream ifs = new oemolistream(ifile);
OEGraphMol qmol = new OEGraphMol();