.. _example env 4zmj:

Example 7:  Closed, Unliganded HIV-1 BG505 Env SOSIP.664 Trimer
---------------------------------------------------------------

`PDB ID 4zmj <https://www.rcsb.org/structure/4zmj>`_ is a structure of the HIV-1 Env BG505 SOSIP-664 ectodomain trimer in a closed conformation, without any ligands bound.  It is one of the earliest X-ray crystal structures solved for this protein in trimeric form.

Pestifer understands how to build a system using any chosen biomolecular assembly available in the structure file.  In the case of `4zmj <https://www.rcsb.org/structure/4ZMJ>`_, the asymmetric unit is a single heterodimeric protomer composed of chains G (gp120) and B (gp41).
The relevant biological assembly is a C3-symmetric homotrimer of protomers, which is labeled biological assembly 1 in the PDB header.  Here we specify that the new chains generated by BIOMT transforms are H and J for chain G and C and D for chain B.  Pestifer will also by default undo any engineered mutations (there are three in 4zmj) and add any unresolved or zero-occupancy residues.  A build of the 4zmj trimer illustrates these capabilities.

.. literalinclude:: ../../../../pestifer/resources/examples/ex07/inputs/hiv-sosip-env-ectodomain1.yaml
    :language: yaml

.. task-table:: ../../../../pestifer/resources/examples/ex07/inputs/hiv-sosip-env-ectodomain1.yaml


There are several new aspects in this example relative to the first four.  First, in the ``psfgen`` task, the ``source`` directive has a ``biological_assembly`` specification with ``transform_reserves`` and ``sequence`` subdirectives.  

Clearly we are indicating biological assembly 1, which you can verify through the RCSB web interface or by reading the PDB file header is the trimer.  

There is also a ``ligate`` task.  Together, the ``loops`` subdirective of the ``sequence`` directive in the ``source``, and the ``ligate`` task, constitute the method of inserting missing residues (residues designated by MISSING records in the PDB or zero-occupancy in the mmCIF).  Building in missing protein loops that are *internal* to any given chain is done in the following way:

1. Via ``residue`` commands inside ``segment`` stanzas of the ``psfgen`` script, each missing residue is indicated.  Additionally, a sacrificial glycine residue is added at the C-terminus of any run of missing residues.  After all ``segments`` are defined, sacrificial glycines are deleted and NTER/CTER patches are explicitly added.  When ``psfgen`` is run, the ``guesscoords`` command results in this missing residues being built in according to their default internal coordinates; this means they grow in as straight chains where every phi and psi angle is 180 degrees.
2. Each such loop is put through a ``declashing`` procedure in which phi and psi angles are adjusteds so that the loop residues do not clash with any other residues.  Sometimes, additional manual adjustment of some dihedrals is necessary; that is the case here.
3. After a minimization, pestifer then runs a ``ligation`` task which has two parts.  First, a steered MD is run that shrinks the distance between the terminal glycine of each loop and the location on the resolved protein to which it should be attached.  Second, another ``psfgen`` run is performed to "heal" the gap between the C-terminus of the loop and its attachment point with a peptide bond.

Declashing is done using a Monte-Carlo approach where trial rotations are suggested and only performed if they result in a reduction in the number of steric clashes.

The 4zmj entry contains partially resolved glycans.  By default, pestifer will include all resolved glycans.  These can be excluded using an ``excludes`` list that specifies ``resnames`` like ``NAG``, ``MAN``, etc.

The snapshots below illustrate the process by which the loops are grown in.  In these snapshots, only backbone protein atoms are shown with bonds drawn as lines.  The model-built parts are drawn with thick bonds, and the six chains are colored uniquely.

.. list-table::

    * - .. figure:: 4zmj_step0.png

           Structure after first ``psfgen``.

      - .. figure:: 4zmj_step1.png

           Structure after declashing loops.

    * - .. figure:: 4zmj_step2-1.png

           Early in the steering.

      - .. figure:: 4zmj_step2-2.png

           Midway through the steering.

    * - .. figure:: 4zmj_step2-3.png

           At the end of the steering.

      - .. figure:: 4zmj_step3.png

           After healing.

           

.. raw:: html

    <div class="autogen-footer">
        <p>Example author: Cameron F. Abrams &nbsp;&nbsp;&nbsp; Contact: <a href="mailto:cfa22@drexel.edu">cfa22@drexel.edu</a></p>
    </div>