MDL Query Depiction

In order to depict an MDL query the query molecule has to be imported by calling the OEReadMDLQueryFile 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 molecule (OERenderMolecule).

Listing 1: Example of MDL query depiction

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

See also

Atom Query Features

The depiction of the following MDL atom query features is supported:

  1. The 8th column in the atom block in the V2K format file (or HCOUNT= in the V3K format file) is used to define the number of allowed hydrogens for an atom. (See examples in Table: Example of depicting hydrogen count)

    • (H0) means no hydrogen atoms allowed unless explicitly drawn.

    • (Hn) means atom must have n or more implicit hydrogen(s)

    Examples of depicting hydrogen count

    query

    ../_images/MDLHCount-01-query.png ../_images/MDLHCount-01-match-0.png ../_images/MDLHCount-01-match-1.png
    ../_images/MDLHCount-02-query.png ../_images/MDLHCount-02-match-0.png ../_images/MDLHCount-02-match-1.png
  2. Query atom types:

    • A = any atom type except hydrogen

    • Q = any atom type except hydrogen and carbon

    • L = atom list

    The M  ALS line in the property block in the V2K format file ( or [aaa,bbb,..] in the V3K format) is used to list alternative atom types for an atom. (See examples in Table: Examples of depicting query atom types)

    Examples of depicting query atom types

    query

    target

    target

    target

    ../_images/MDLGenericAtom-01-query.png ../_images/MDLGenericAtom-01-match-0.png ../_images/MDLGenericAtom-01-match-1.png ../_images/MDLGenericAtom-01-match-2.png
    ../_images/MDLGenericAtom-02-query.png ../_images/MDLGenericAtom-02-match-0.png ../_images/MDLGenericAtom-02-match-1.png ../_images/MDLGenericAtom-02-match-2.png
    ../_images/MDLGenericAtom-03-query.png ../_images/MDLGenericAtom-03-match-0.png ../_images/MDLGenericAtom-03-match-1.png ../_images/MDLGenericAtom-03-match-2.png
    ../_images/MDLGenericAtom-04-query.png ../_images/MDLGenericAtom-04-match-0.png ../_images/MDLGenericAtom-04-match-1.png ../_images/MDLGenericAtom-04-match-2.png
  3. M  CHG line in the property block in the V2K format file (or CHG= in the V3K format) is used to define atom formal charges. (See examples in Table: Example of depicting formal charge)

    Examples of depicting formal charge

    query

    target

    target

    ../_images/MDLCharge-01-query.png ../_images/MDLCharge-01-match-0.png ../_images/MDLCharge-01-match-1.png
  4. M  RBC line in the property block in the V2K format file (or RBCNT= in the V3K format) is used to limit the number of allowed ring bonds attached to an atom. (See examples in Table: Example of depicting ring count)

    • (r0) means no ring bond allowed

    • (r*) means as drawn

    • (rn) means n number of ring bonds allowed

    Examples of depicting ring count

    query

    target

    target

    ../_images/MDLRingCount-01-query.png ../_images/MDLRingCount-01-match-0.png ../_images/MDLRingCount-01-match-1.png
    ../_images/MDLRingCount-02-query.png ../_images/MDLRingCount-02-match-0.png ../_images/MDLRingCount-02-match-1.png
  5. M  SUB line in the property block in the V2K format file (or SUBST= in the V3K format) is used to set the number of allowed substitutions of an atom. (See examples in Table: Examples of depicting substitution count)

    • (s0) means no substitution allowed

    • (s*) means as drawn

    • (sn) means n number of substitution(s) allowed

    Examples of depicting substitution count

    query

    target

    target

    ../_images/MDLSubCount-01-query.png ../_images/MDLSubCount-01-match-0.png ../_images/MDLSubCount-01-match-1.png
    ../_images/MDLSubCount-02-query.png ../_images/MDLSubCount-02-match-0.png ../_images/MDLSubCount-02-match-1.png
  6. M  UNS line in the property block in the V2K format file (or UNSAT= in the V3K format) is used to specify whether or not an atom is unsaturated, i.e., having at least one multiple bond. (See examples in Table: Examples of depicting unsaturated property)

    Examples of depicting unsaturated property

    query

    target

    target

    ../_images/MDLUnsaturated-01-query.png ../_images/MDLUnsaturated-01-match-0.png ../_images/MDLUnsaturated-01-match-1.png

Bond Query Features

The depiction of the following MDL bond query features is supported:

  1. Alternative bond types in the bond block (4 = aromatic, 5 = single or double, 6 = single or aromatic, 7 = double or aromatic, 8 = any bond). (See examples in Table: Examples of depicting query bond types)

    Examples of depicting query bond types

    query

    target

    target

    target

    ../_images/MDLGenericBond-01-query.png ../_images/MDLGenericBond-01-match-0.png ../_images/MDLGenericBond-01-match-1.png ../_images/MDLGenericBond-01-match-2.png
    ../_images/MDLGenericBond-02-query.png ../_images/MDLGenericBond-02-match-0.png ../_images/MDLGenericBond-02-match-1.png ../_images/MDLGenericBond-02-match-2.png
    ../_images/MDLGenericBond-03-query.png ../_images/MDLGenericBond-03-match-0.png ../_images/MDLGenericBond-03-match-1.png ../_images/MDLGenericBond-03-match-2.png

    See also

  2. The 6th column in the atom block in the V2K format file ( or TOPO= in the V3K format) describes bond topology. (See examples in Table: Examples of depicting bond topology)

    • (rn) means that it can only mapped to ring bond

    • (ch) means that it can only mapped to chain bond

    Examples of depicting bond topology

    query

    target

    target

    ../_images/MDLTopology-01-query.png ../_images/MDLTopology-01-match-0.png ../_images/MDLTopology-01-match-1.png
    ../_images/MDLTopology-02-query.png ../_images/MDLTopology-02-match-0.png ../_images/MDLTopology-02-match-1.png
  3. Double bond stereochemistry is considered if both ends of the bond are marked with stereo care flags in the atom block in the V2K format file ( or STBOX= in the V3K format). (See examples in Table: Examples of depicting bond stereo care)

    Examples of depicting bond stereo care

    query

    target

    target

    ../_images/MDLBondStereo-01-query.png ../_images/MDLBondStereo-01-match-0.png ../_images/MDLBondStereo-01-match-1.png
    ../_images/MDLBondStereo-02-query.png ../_images/MDLBondStereo-02-match-0.png ../_images/MDLBondStereo-02-match-1.png

See also

R-group Depiction

OEDepict TK can also depict R-group information by interpreting the M  RGP line in the property block of an MDL file (See examples in Table: Examples of depicting R-groups)

Examples of depicting R-groups
../_images/RGroup-01.png ../_images/RGroup-02.png