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)

    System.out.format("num\tatom\t%s\t%s\t%s\t%s\t%s%n",
                oeszmap.OEGetEnsembleName(OEEnsemble.NeutralDiffDeltaG),
                oeszmap.OEGetEnsembleName(OEEnsemble.PSolv),
                oeszmap.OEGetEnsembleName(OEEnsemble.WSolv),
                oeszmap.OEGetEnsembleName(OEEnsemble.VDW),
                oeszmap.OEGetEnsembleName(OEEnsemble.OrderParam) );

    OEFloatArray coord = new OEFloatArray(3);

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

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

        if (! oeszmap.OEIsClashing(sz, coord)) {
            oeszmap.OECalcSzmapResults(result, sz, coord);

            System.out.format("%2d\t%s\t%.3f\t%.3f\t%.3f\t%.3f\t%.3f%n",
                    i, atom.GetName(),
                    result.GetEnsembleValue(OEEnsemble.NeutralDiffDeltaG),
                    result.GetEnsembleValue(OEEnsemble.PSolv),
                    result.GetEnsembleValue(OEEnsemble.WSolv),
                    result.GetEnsembleValue(OEEnsemble.VDW),
                    result.GetEnsembleValue(OEEnsemble.OrderParam) );
        } else {
            System.out.format("%2d\t%s CLASH%n", 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)

    OEFloatArray coord = new OEFloatArray(3);

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

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

    OEMol probes = new OEMol();

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

        if (!oeszmap.OEIsClashing(sz, coord)) {
            oeszmap.OECalcSzmapResults(result, sz, coord);

            result.PlaceNewAtom(points);

            boolean clear = false;
            result.PlaceProbeSet(probes, cumulativeProb, clear);
        }
    }

    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