Working with Szmap TK

The Szmap TK has a simple API, consisting of a few basic API and a couple of objects to configure the calculations (OESzmapEngine and OESzmapEngineOptions) and hold calculated results (OESzmapResults).

Preparing Protein and Ligand Molecules

To perform the necessary electrostatics calculations, a protein or any other molecular context being analyzed with SZMAP must already have all hydrogens explicitly represented as well as have charges and radii assigned before it can be used. This is done automatically as part of protein preparation with Spruce TK (see OEMakeDesignUnits). Charges can also be assigned using Quacpac TK (see OEAssignCharges).

Calculating Energies

To calculate probe energies, we initialize a OESzmapEngine with a molecular context, test if the point of interest is clashing, and if not, calculate the energies. In the example below, the energies at each ligand atom coordinate are returned in a OESzmapResults object, which is accessed for specific values. Alternatively, OECalcSzmapValue could be used to get a single OEEnsemble value directly.

private static void GetSzmapEnergies(OEMolBase lig, OEMolBase prot)
{
    //run szmap at ligand coordinates in the protein context

    //lig: mol defining coordinates for szmap calcs
    //prot: context mol for szmap calcs (must have charges and radii)

    Console.WriteLine("num\tatom\t{0}\t{1}\t{2}\t{3}\t{4}",
                OESzmap.OEGetEnsembleName(OEEnsemble.NeutralDiffDeltaG),
                OESzmap.OEGetEnsembleName(OEEnsemble.PSolv),
                OESzmap.OEGetEnsembleName(OEEnsemble.WSolv),
                OESzmap.OEGetEnsembleName(OEEnsemble.VDW),
                OESzmap.OEGetEnsembleName(OEEnsemble.OrderParam) );

    float[] coord = new float[3];

    OESzmapEngine sz = new OESzmapEngine(prot);
    OESzmapResults rslt = new OESzmapResults();

    int i = 0;
    foreach (OEAtomBase atom in lig.GetAtoms())
    {
        lig.GetCoords(atom, coord);

        if (!OESzmap.OEIsClashing(sz, coord))
        {
            OESzmap.OECalcSzmapResults(rslt, sz, coord);

            Console.WriteLine("{0,2:d}\t{1}\t{2:F3}\t{3:F3}\t{4:F3}\t{5:F3}\t{6:F3}f",
                    i, atom.GetName(),
                    rslt.GetEnsembleValue(OEEnsemble.NeutralDiffDeltaG),
                    rslt.GetEnsembleValue(OEEnsemble.PSolv),
                    rslt.GetEnsembleValue(OEEnsemble.WSolv),
                    rslt.GetEnsembleValue(OEEnsemble.VDW),
                    rslt.GetEnsembleValue(OEEnsemble.OrderParam) );
        }
        else
        {
            Console.WriteLine("{0,2:d}\t{1} CLASH", i, atom.GetName());
        }
        i++;
    }
}

The five OEEnsemble values in the example above are the primary ones for understanding solvent/ligand competition.

See also

Generating Probe Orientations

In addition to energy calculations, the Szmap TK can be used to generate 3D conformations of probe molecules at calculated points, annotated with OEComponent energies for each conformation. In the example below, individual atoms are also generated at calculation points, each annotated with OEEnsemble values.

private static void GenerateSzmapProbes(oemolostream oms,
                                        double cumulativeProb,
                                        OEMolBase lig,
                                        OEMolBase prot)
{
    //generate multiconf probes and data-rich points at ligand coords

    //oms: output mol stream for points and probes
    //cumulativeProb: cumulative probability for cutoff of point set
    //lig: mol defining coordinates for szmap calcs
    //prot: context mol for szmap calcs (must have charges and radii)

    float[] coord = new float[3];

    OESzmapEngine sz = new OESzmapEngine(prot);
    OESzmapResults rslt = new OESzmapResults();

    OEGraphMol points = new OEGraphMol();
    string title = "points " + lig.GetTitle();
    points.SetTitle(title);

    OEMol probes = new OEMol();

    int i = 0;
    foreach (OEAtomBase atom in lig.GetAtoms())
    {
        lig.GetCoords(atom, coord);

        if (!OESzmap.OEIsClashing(sz, coord))
        {
            OESzmap.OECalcSzmapResults(rslt, sz, coord);

            rslt.PlaceNewAtom(points);

            bool clear = false;
            rslt.PlaceProbeSet(probes, cumulativeProb, clear);
        }

        i++;
    }

    OEChem.OEWriteMolecule(oms, points);
    OEChem.OEWriteMolecule(oms, probes);
}
../_images/szmaptk-labeled-orientations.png

High Probability Probe Orientations and Points with Generic Data Annotation

See also