.. _szmap_tutorial_run:
.. include:: ../substitutions
.. include:: ../../apps-substitutions

=========================================
Running SZMAP Stabilization Calculations
=========================================

Assuming the input structures have been prepared as described above,
:ref:`chapter_szmap` grids can be calculated
for the region around the ligand as follows:

::

   > szmap -mpi_np 4 -prefix 4std_stbl -stbl -p 4STD_ABC__DU__BFS_A-173.oedu -excludeDUsolvent

   or

   > szmap -mpi_np 4 -prefix 4std_stbl -stbl -p 4STD_A__DU__BFS_A-173_target.oeb.gz -l 4STD_A__DU__BFS_A-173_ligand.oeb.gz

.. note::

   The option ``-excludeDUsolvent`` is needed to exclude structural waters from the stabilization calculation if the input is
   using a design unit.

Stabilization calculations can also be performed with a dataset of pre-posed non-native ligands, using the commands below.

::

   > szmap -mpi_np 4 -prefix 4std_stbl -stbl -p 4STD_ABC__DU__BFS_A-173.oedu -excludeDUsolvent -l posed_ligands.oeb


Calculations for *complex, apo,* and *ligand* grids will be done
(requiring about 40 minutes for this example on Linux using four 2.8GHz processors)
and then further processed to yield
*(complex - apo - ligand)* stabilization
grids, describing where water is stabilizing or destabilizing the
binding reaction. The output consists of the calculated grids in an *.oeb.gz* file, along
with a parameter file and a log file, all with names prefixed with "4std_stbl".

To run on only a single processor, drop the ``-mpi_np #`` option.
More information on options can be found in chapter :ref:`chapter_szmap`.

.. note::

   :ref:`chapter_szmap` (and :ref:`chapter_gameplan`) will check for missing hydrogens
   and missing partial charges and halt if they are missing on the protein, but that will typically
   not be a problem if the input is an OEDesignUnit. It also shouldn't be a problem with the ligand
   read from an OEDesignUnit, however, if a ligand is passed with missing partial charges, they will be assigned
   AM1BCC charges and Zap9 radii. If reading from a PDB, sometimes, OEChem will have a different
   opinion about the charge or bond order than what you expect. For example, if your structure has
   significantly nonterminal geometry around an aromatic or double bond,
   OEChem may try to treat it as a single bond. The option ``-warn_if_missing_hydrogens``
   will allow you to run :ref:`chapter_szmap` and :ref:`chapter_gameplan` despite OEChem
   thinking there are hydrogens that are not explicitly in your structure. But you may
   also need to change the formal charge of a polar group before running pch, either in
   *VIDA's* builder or by modifying the structure file using a text editor.
