.. _section_example_oebio_proteinprep:

Preparing a Protein
================================================================================

A program that selects the highest occupancy alternate locations of a protein,
adds hydrogens in orientations that make appropriate hydrogen bonds,
and splits out the complex for the selected binding site (optionally separating
the ligand from the protein complex). This is an initial prototype of a
"protein prep" workflow.

An example command that splits out the ligand and limits water sampling
is as follows:

.. oe:language:: c++

   .. code-block:: console

      prompt> proteinprep -waterprocessing ignore input.pdb prot.oeb.gz lig.oeb.gz

.. oe:language:: python

   .. code-block:: console

      prompt> python proteinprep.py -waterprocessing ignore input.pdb prot.oeb.gz lig.oeb.gz

.. oe:language:: java

   .. code-block:: console

      prompt> ProteinPrep -waterprocessing ignore input.pdb prot.oeb.gz lig.oeb.gz

.. oe:language:: csharp

   .. code-block:: console

      prompt> ProteinPrep -waterprocessing ignore input.pdb prot.oeb.gz lig.oeb.gz

Help is available for all the supported parameters:

.. oe:language:: c++

   .. code-block:: console

       prompt> proteinprep --help all

.. oe:language:: python

   .. code-block:: console

      prompt> python proteinprep.py --help all

.. oe:language:: java

   .. code-block:: console

      prompt> ProteinPrep --help all

.. oe:language:: csharp

   .. code-block:: console

      prompt> ProteinPrep --help all

::

   proteinprep [-options] <inmol> [<outcplx> [<outlig>]]
   Complete parameter list
       SplitMolComplex options :
         -bindingsitenum : Select this binding site
         -covalentligand : Split covalent ligands
         -ligandfilter : Ligand filter category
         -ligandname : Ligand name
         -maxsitedistance : Maximum distance to be associated with the binding site
         -maxsurfacedistance : Maximum distance to be associated with the protein
                               surface
         -modelnum : Select this NMR model number
         -proteinfilter : Protein filter category
         -separateresidues : Separate individual residues before selection
         -surfacewaters : Select surface waters
         -waterfilter : Water filter category

       input/output options :
         -in : Input molecule filename (must have 3D coordinates)
         -cplxout : Output complex filename
         -ligout : Output ligand filename

       Calculation options :
         -alts : Alternate location atom handling (affects atom:atom interactions)
         -placehydrogens : If false, hydrogens will not be added
         -waterprocessing : How waters are processed (can greatly affect runtime)
         -standardizehyd : If false, bonds for hydrogens are not adjusted to standard
                         lengths
         -clashcutoff : Van der Waals overlap (in Angstroms) defined to be a bad
                        clash
         -flipbias : Scale factor for the bias against flipping sidechains such as
                     HIS

       Display options :
         -verbose : Display more information about the process

Code
--------------------------------------------------------------------------------

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`proteinprep.cpp <../../../../../sublibs/tklibs/bio/examples/proteinprep.cpp>`
         and
         :download:`proteinprep.txt <../../../../../sublibs/tklibs/bio/examples/proteinprep.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: proteinprep.cpp
         :language: c++

      with interface file

      .. oe:source:: proteinprep.txt
         :language: c++

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`proteinprep.py <../../../../../wrappers/python/examples/bio/proteinprep.py>`

      ..    literalinclude:: ../../../../../wrappers/python/examples/bio/proteinprep.py

   .. only:: oepdf

      .. oe:source:: proteinprep.py
         :language: python

.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ProteinPrep.java <../../../../../wrappers/java/examples/openeye/examples/oebio/ProteinPrep.java>`
         and
         :download:`ProteinPrep.txt <../../../../../wrappers/java/examples/openeye/examples/oebio/ProteinPrep.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: ProteinPrep.java
         :language: java

      with interface file

      .. oe:source:: ProteinPrep.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`ProteinPrep.cs <../../../../../wrappers/csharp/Csharp-Examples/OEBio/ProteinPrep.cs>`

   .. only:: oepdf

      .. oe:source:: ProteinPrep.cs
         :language: csharp


.. seealso::

   * :ref:`chapter_protein_prep` section
   * :ref:`OEAltLocationFactory <OEBio_OEAltLocationFactory>` object
   * :oe:const:`OEChem::OEIFlavor::PDB::ALTLOC` flavor
   * :oe:func:`OEBio::OEGetMolComplexFragments` function
   * :oe:func:`OEBio::OECombineMolComplexFragments` function
   * :ref:`OESplitMolComplexOptions <OEBio_OESplitMolComplexOptions>` object
   * :oe:func:`OEBio::OEConfigureSplitMolComplexOptions` function
   * :oe:func:`OEBio::OESplitMolComplexSetup` function
   * :oe:func:`OEBio::OEPlaceHydrogens` function
   * :ref:`OEPlaceHydrogensOptions <OEBio_OEPlaceHydrogensOptions>` object
   * :ref:`OEPlaceHydrogensDetails <OEBio_OEPlaceHydrogensDetails>` object
