Skip to content
Snippets Groups Projects
Commit fe5f16fb authored by Studer Gabriel's avatar Studer Gabriel
Browse files

update documentation of sidechain module

parent 8adc7cc4
Branches
Tags
No related merge requests found
...@@ -5,7 +5,8 @@ from promod3 import sidechain ...@@ -5,7 +5,8 @@ from promod3 import sidechain
prot = io.LoadPDB('data/1CRN.pdb') prot = io.LoadPDB('data/1CRN.pdb')
# load rotamer library # load rotamer library
library = sidechain.LoadDunbrackLib() library = sidechain.LoadDunbrackLib()
# we need a rotamer constructor to create any rotamers or frame residues # we need a rotamer constructor to create any rotamers or
# frame residues
rot_constructor = sidechain.SCWRLRotamerConstructor() rot_constructor = sidechain.SCWRLRotamerConstructor()
# create new entity from protein only containing the amino acids # create new entity from protein only containing the amino acids
......
...@@ -5,7 +5,7 @@ rotamer.rst ...@@ -5,7 +5,7 @@ rotamer.rst
rotamer_id.rst rotamer_id.rst
frame.rst frame.rst
rotamer_lib.rst rotamer_lib.rst
sidechain_settings.rst rotamer_constructor.rst
graph.rst graph.rst
disulfid.rst disulfid.rst
loading.rst loading.rst
......
...@@ -18,9 +18,6 @@ The Frame Objects ...@@ -18,9 +18,6 @@ The Frame Objects
.. class:: FrameResidue(particles, residue_index) .. class:: FrameResidue(particles, residue_index)
The most simple way of constructing a frame residue is the usage
of the convenient functions provided by PROMOD3.
:param particles: particles building frame residue :param particles: particles building frame residue
:param residue_index: Interaction energies between the constructed frame :param residue_index: Interaction energies between the constructed frame
residue and any rotamer associated to the same residue and any rotamer associated to the same
...@@ -47,30 +44,12 @@ The Frame Objects ...@@ -47,30 +44,12 @@ The Frame Objects
.. class:: Frame(frame_residues) .. class:: Frame(frame_residues)
The :class:`Frame` object allows to calculate frame energies for rotamers. The :class:`Frame` object is used as a container for rigid particles, that
Due to technical reasons, this is only possible if the rotamers are can be passed to rotamer groups for calculating frame energies.
part of rotamer groups.
:param frame_residues: residues building the frame. :param frame_residues: residues building the frame.
:type frame_residues: :class:`list` of :class:`FrameResidue` :type frame_residues: :class:`list` of :class:`FrameResidue`
.. method:: SetFrameEnergy(rotamer_group)
Calculates and sets frame energies for all rotamers in the rotamer group.
:param rotamer_group: group of rotamers for energy calculation
:type rotamer_group: :class:`RRMRotamerGroup` / :class:`FRMRotamerGroup`
.. method:: AddFrameEnergy(rotamer_group)
Calculates and adds frame energies to the already existing frame
energy values for all rotamers in the rotamer group.
This is useful if you have several :class:`Frame` objects.
:param rotamer_group: group of rotamers for energy calculation
:type rotamer_group: :class:`RRMRotamerGroup` / :class:`FRMRotamerGroup`
Convenient functions for constructing frame residues Convenient functions for constructing frame residues
......
...@@ -19,18 +19,11 @@ and finally comes back with a solution. ...@@ -19,18 +19,11 @@ and finally comes back with a solution.
.. staticmethod:: CreateFromRRMList(rotamer_groups) .. staticmethod:: CreateFromRRMList(rotamer_groups)
:param rotamer_groups: :class:`RRMRotamerGroup` objects representing the
possible sidechain conformations for every amino
acid position.
:type rotamer_groups: :class:`list`
.. staticmethod:: CreateFromFRMList(rotamer_groups) .. staticmethod:: CreateFromFRMList(rotamer_groups)
:param rotamer_groups: :class:`FRMRotamerGroup` objects representing the :param rotamer_groups: :class:`RRMRotamerGroup` or :class:`FRMRotamerGroup`
possible sidechain conformations for every amino objects representing the possible sidechain
acid position. conformations for every amino acid position.
:type rotamer_groups: :class:`list` :type rotamer_groups: :class:`list`
......
...@@ -40,7 +40,10 @@ Contents: ...@@ -40,7 +40,10 @@ Contents:
rotamer rotamer
frame frame
rotamer_lib rotamer_lib
rotamer_constructor
graph graph
sidechain_settings
disulfid disulfid
loading loading
.. [krivov2009] Krivov GG, Shapovalov MV and Dunbrack RL Jr. (2009). Improved prediction of protein side-chain conformations with SCWRL4. Proteins.
...@@ -25,8 +25,8 @@ the backbone independent Penultimate library [lovell2000]_ . ...@@ -25,8 +25,8 @@ the backbone independent Penultimate library [lovell2000]_ .
Loads the backbone independent Penultimate library. The values for the dihedral Loads the backbone independent Penultimate library. The values for the dihedral
angles are directly extracted from the publication without considering the angles are directly extracted from the publication without considering the
probabilities specifically for helices/sheets. Due to no assigned standard probabilities specific for helices/sheets. Due to no assigned standard
deviations, the flexible rotamer model won't work. deviations, the flexible rotamer model won't produce meaningful results.
:returns: The requested library :returns: The requested library
:rtype: :class:`RotamerLib` :rtype: :class:`RotamerLib`
...@@ -36,7 +36,7 @@ the backbone independent Penultimate library [lovell2000]_ . ...@@ -36,7 +36,7 @@ the backbone independent Penultimate library [lovell2000]_ .
Reads a file as it is provided when you get a licence for the 2010 library of Reads a file as it is provided when you get a licence for the 2010 library of
the Dunbrack lab. It can only read the classic version, where all rotamers the Dunbrack lab. It can only read the classic version, where all rotamers
are in a single file. Specific distributions of nonrotameric sidechains also are in a single file. Specific distributions of nonrotameric sidechains
cannot be read. cannot be read.
:param filename: Name of the file :param filename: Name of the file
...@@ -51,8 +51,6 @@ the backbone independent Penultimate library [lovell2000]_ . ...@@ -51,8 +51,6 @@ the backbone independent Penultimate library [lovell2000]_ .
:rtype: :class:`BBDepRotamerLib` :rtype: :class:`BBDepRotamerLib`
.. [krivov2009] Krivov GG, Shapovalov MV and Dunbrack RL Jr. (2009). Improved prediction of protein side-chain conformations with SCWRL4. Proteins.
.. [shapovalov2011] Shapovalov MV and Dunbrack RL Jr. (2011). A smoothed backbone-dependent rotamer library for proteins derived from adaptive kernel density estimates and regressions. Structure. .. [shapovalov2011] Shapovalov MV and Dunbrack RL Jr. (2011). A smoothed backbone-dependent rotamer library for proteins derived from adaptive kernel density estimates and regressions. Structure.
.. [lovell2000] Lovell SC, Word JM, Richardson JS, Richardson DC (2000). The penultimate rotamer library. Proteins. .. [lovell2000] Lovell SC, Word JM, Richardson JS, Richardson DC (2000). The penultimate rotamer library. Proteins.
......
...@@ -3,15 +3,17 @@ Rotamers ...@@ -3,15 +3,17 @@ Rotamers
.. currentmodule:: promod3.sidechain .. currentmodule:: promod3.sidechain
The rotamers in PROMOD3 are heavily based on the definitions from SCWRL4. A rotamer represents an amino acid sidechain and is basically a set of
A rotamer is basically a set of :class:`Particle` and exists in two types. :class:`Particle` objects. There exist two types. The :class:`RRMRotamer` and
The :class:`RRMRotamer` and :class:`FRMRotamer`. Pairwise energies between :class:`FRMRotamer`.
rotamer instances get calculated according to the definitions from SCWRL4.
To gather all possible rotamers for one particular sidechain position, To gather all possible rotamers for one particular sidechain position,
PROMOD3 has the :class:`RRMRotamerGroup` and :class:`FRMRotamerGroup`. PROMOD3 offers the :class:`RRMRotamerGroup` and :class:`FRMRotamerGroup`.
Rotamers are not intended to be built from scratch. Pairwise interactions between particles give raise to pairwise energies between
PROMOD3 offers a built-in construction function, directly accessing a rotamers. Nevertheless, the energy calculation itself happens on the level
:class:`BBDepRotamerLib`. of RotamerGroups and is mostly hidden away in the construction of the
the :class:`RotamerGraph`. If you're too lazy to build up your rotamers
by hand, you might be interested in the :class:`SCWRLRotamerConstructor`.
The Smallest Building Block - The Particle The Smallest Building Block - The Particle
...@@ -114,11 +116,24 @@ Rotamers ...@@ -114,11 +116,24 @@ Rotamers
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
.. class:: RRMRotamer .. class:: RRMRotamer(particles, probability, internal_e_prefactor)
The RRMRotamer represents a rotamer of the so called rigid rotamer model. The RRMRotamer represents a rotamer of the so called rigid rotamer model.
The class has no constructor exported to python, the rotamer is expected to
be constructed with the convenient functions provided by PROMOD3. :param particles: List of :class:`Particle` objects
:param probability: Probability of rotamers. In case of the SCWRL4
energy calculation, this directly controls the
internal energy of that rotamer.
:param internal_e_prefactor: Factor applied to the internal energy calculated
as -log(**probability**/max_probability),
where max_probability is the maximum
rotamer probability of any rotamer in a
particular :class:`RRMRotamerGroup`.
:type particles: :class:`list`
:type probability: :class:`float`
:type internal_e_prefactor: :class:`float`
.. method:: __getitem__(index) .. method:: __getitem__(index)
...@@ -139,13 +154,14 @@ Rotamers ...@@ -139,13 +154,14 @@ Rotamers
.. method:: ApplyOnResidue(res, consider_hydrogens=False, new_res_name="") .. method:: ApplyOnResidue(res, consider_hydrogens=False, new_res_name="")
Strips all sidechain atom positions of given residue and reconstructs the Iterates over every particle and searches for the according atom in
full sidechain given the positions of the particles in the rotamer. **res**. If it's present, the position gets reset to the particle position.
If not, a new atom gets added to **res**.
:param res: Residue to be reconstructed :param res: Residue to be reconstructed
:param consider_hydrogens: Flag, whether polar hydrogens should be added to :param consider_hydrogens: Flag, whether polar hydrogens should be added to
the sidechain **res**
:param new_res_name: New name of residue. Nothing happens in case of the :param new_res_name: New name of **res**. Nothing happens in case of the
default value ("") default value ("")
:type res: :class:`ost.mol.ResidueHandle` :type res: :class:`ost.mol.ResidueHandle`
...@@ -168,26 +184,10 @@ Rotamers ...@@ -168,26 +184,10 @@ Rotamers
:raises: :exc:`~exceptions.RuntimeError` if *res_idx* is invalid :raises: :exc:`~exceptions.RuntimeError` if *res_idx* is invalid
.. method:: GetTransformedCopy(transform)
Transforms all particle positions including their lone pair and polar
directions.
:param transform: Transformation to be applied
:type transform: :class:`ost.geom.Transform` .. method:: GetInternalEnergyPrefactor()
:returns: :class:`RRMRotamer` with all particles transformed
.. method:: CalculateInternalEnergy(normalization_factor)
Calculates and sets the rotamer internal energy of the form:
-prefactor*log(probability/normalization_factor)
:param normalization_factor: Normalization factor for internal probability
:type normalization_factor: :class:`float` :returns: Prefactor used in internal energy calculation
.. method:: GetInternalEnergy() .. method:: GetInternalEnergy()
...@@ -195,15 +195,11 @@ Rotamers ...@@ -195,15 +195,11 @@ Rotamers
:returns: Internal Energy if calculated, 0.0 otherwise :returns: Internal Energy if calculated, 0.0 otherwise
.. method:: GetInternalEnergyPrefactor()
:returns: Prefactor used in internal energy calculation
.. method:: GetFrameEnergy() .. method:: GetFrameEnergy()
Returns previously calculated frame energy, this energy has to be calculated Returns frame energy. This energy can either be manually set or calculated
using a :class:`Frame`. using a :class:`Frame` and the :class:`RRMRotamerGroup` this rotamer
belongs to.
:returns: Frame energy if calculated, 0.0 otherwise :returns: Frame energy if calculated, 0.0 otherwise
...@@ -218,16 +214,16 @@ Rotamers ...@@ -218,16 +214,16 @@ Rotamers
:returns: probability of this rotamer :returns: probability of this rotamer
.. method:: SetInternalEnergy(energy) .. method:: SetInternalEnergyPrefactor(prefactor)
:param energy: Internal energy to be set :param energy: Internal energy prefactor to be set
:type energy: :class:`float` :type energy: :class:`float`
.. method:: SetInternalEnergyPrefactor(prefactor) .. method:: SetInternalEnergy(energy)
:param energy: Internal energy prefactor to be set :param energy: Internal energy to be set
:type energy: :class:`float` :type energy: :class:`float`
...@@ -239,6 +235,13 @@ Rotamers ...@@ -239,6 +235,13 @@ Rotamers
:type energy: :class:`float` :type energy: :class:`float`
.. method:: AddFrameEnergy(energy)
:param energy: Frame energy to be added
:type energy: :class:`float`
.. method:: SetProbability(probability) .. method:: SetProbability(probability)
:param energy: Internal probability to be set :param energy: Internal probability to be set
...@@ -247,14 +250,31 @@ Rotamers ...@@ -247,14 +250,31 @@ Rotamers
.. class:: FRMRotamer .. class:: FRMRotamer(particles, T, probability, internal_e_prefactor)
The FRMRotamer represents a rotamer of the so called flexible rotamer model,
where one rotamer gets represented by several subrotamers.
The idea is, that all particles of all subrotamers are given at
initialization. Subrotamers are then defined by providing lists of indices.
One particle can be part of several subrotamers.
The FRMRotamer represents a rotamer of the so called flexible rotamer model. :param particles: List of :class:`Particle` objects
The class has no constructor exported to python, the rotamer is expected to :param probability: Probability of rotamers. In case of the SCWRL4
be constructed with the convenient functions provided by PROMOD3. energy calculation, this directly controls the
The flexible rotamer contains several so called subrotamers. The internal data internal energy of that rotamer.
layout is a list of particles and a list of subrotamer definitions in form :param T: Temperature factor, that is used to generate a final
of particle indices. energy given the subrotamers according to the formalism
described in the SCWRL4 paper.
:param internal_e_prefactor: Factor applied to the internal energy calculated
as -log(**probability**/max_probability),
where max_probability is the maximum
rotamer probability of any rotamer in a
particular :class:`FRMRotamerGroup`.
:type particles: :class:`list`
:type probability: :class:`float`
:type T: :class:`float`
:type internal_e_prefactor: :class:`float`
.. method:: __getitem__(index) .. method:: __getitem__(index)
...@@ -279,35 +299,11 @@ Rotamers ...@@ -279,35 +299,11 @@ Rotamers
:returns: Number of subrotamers :returns: Number of subrotamers
.. method:: GetSubrotamerDefinition(index)
:param index: Index of subrotamer
:type index: :class:`int`
:returns: :class:`list` of particle indices belonging to this
particular subrotamer
:raises: :exc:`~exceptions.RuntimeError` if index is invalid
.. method:: GetSubrotamerAssociations(index)
:param index: Index of particle
:type index: :class:`int`
:returns: :class:`list` of subrotamer indices this particle is
associated with
:raises: :exc:`~exceptions.RuntimeError` if index is invalid
.. method:: ApplyOnResidue(res, consider_hydrogens=False, new_res_name="") .. method:: ApplyOnResidue(res, consider_hydrogens=False, new_res_name="")
Strips all sidechain atom positions of given residue and reconstructs the Iterates over every particle of the first subrotamer and searches for the
full sidechain given the positions of the particles in the rotamer. according atom in **res**. If it's present, the position gets reset to the
particle position. If not, a new atom gets added to **res**.
:param res: Residue to be reconstructed :param res: Residue to be reconstructed
:param consider_hydrogens: Flag, whether polar hydrogens should be added to :param consider_hydrogens: Flag, whether polar hydrogens should be added to
...@@ -335,51 +331,37 @@ Rotamers ...@@ -335,51 +331,37 @@ Rotamers
:raises: :exc:`~exceptions.RuntimeError` if *res_idx* is invalid :raises: :exc:`~exceptions.RuntimeError` if *res_idx* is invalid
.. method:: GetSubrotamerDefinition(index)
.. method:: GetTransformedCopy(transform) :param index: Index of subrotamer
Transforms all particle positions including their lone pair and polar
directions.
:param transform: Transformation to be applied
:type transform: :class:`ost.geom.Transform`
:returns: :class:`FRMRotamer` with all particles transformed
:type index: :class:`int`
.. method:: CalculateInternalEnergy(normalization_factor) :returns: :class:`list` of particle indices belonging to this
particular subrotamer
Calculates and sets the rotamer internal energy of the form: :raises: :exc:`~exceptions.RuntimeError` if index is invalid
-prefactor*log(probability/normalization_factor)
:param normalization_factor: Normalization factor for internal probability
:type normalization_factor: :class:`float` .. method:: GetInternalEnergyPrefactor()
:returns: Prefactor used in internal energy calculation
.. method:: GetInternalEnergy() .. method:: GetInternalEnergy()
:returns: Internal Energy if calculated, 0.0 otherwise :returns: Internal Energy if calculated, 0.0 otherwise
.. method:: GetInternalEnergyPrefactor()
:returns: Prefactor used in internal energy calculation
.. method:: GetFrameEnergy() .. method:: GetFrameEnergy()
Returns previously calculated frame energy of the full FRMRotamer, this Returns frame energy. This energy can either be manually set or calculated
energy has to be calculated using a :class:`Frame`. using a :class:`Frame` and the :class:`FRMRotamerGroup` this rotamer
belongs to.
:returns: Frame energy if calculated, 0.0 otherwise :returns: Frame energy if calculated, 0.0 otherwise
.. method:: GetFrameEnergy(index) .. method:: GetFrameEnergy(index)
Returns previously calculated frame energy of the subrotamer specified by Returns frame energy of specified **index**.
*index*, this energy has to be calculated using a :class:`Frame`.
:param index: Index of subrotamer you want the frame energy from :param index: Index of subrotamer you want the frame energy from
...@@ -405,35 +387,56 @@ Rotamers ...@@ -405,35 +387,56 @@ Rotamers
:returns: Probability of this rotamer :returns: Probability of this rotamer
.. method:: SetInternalEnergy(energy) .. method:: SetInternalEnergyPrefactor(prefactor)
:param energy: Internal energy to be set :param energy: Internal energy prefactor to be set
:type energy: :class:`float` :type energy: :class:`float`
.. method:: SetInternalEnergyPrefactor(prefactor) .. method:: SetInternalEnergy(energy)
:param energy: Internal energy prefactor to be set :param energy: Internal energy to be set
:type energy: :class:`float` :type energy: :class:`float`
.. method:: SetFrameEnergy(energy) .. method:: SetFrameEnergy(energy)
:param energy: Frame energy for full rotamer to be set to be set :param energy: Frame energy for full rotamer to be set
:type energy: :class:`float` :type energy: :class:`float`
.. method:: SetFrameEnergy(energy, index) .. method:: SetFrameEnergy(energy, index)
:param energy: Frame energy for single subrotamer to be set to be set :param energy: Frame energy for single subrotamer to be set
:param index: Index of subrotamer
:type energy: :class:`float`
:type index: :class:
.. method:: AddFrameEnergy(energy)
:param energy: Frame energy for full rotamer to be added
:type energy: :class:`float`
.. method:: AddFrameEnergy(energy, index)
:param energy: Frame energy for single subrotamer to be added
:param index: Index of subrotamer :param index: Index of subrotamer
:type energy: :class:`float` :type energy: :class:`float`
:type index: :class: :type index: :class:
.. method:: AddSubrotamerDefinition(indices)
:param indices: List of indices defining a subrotamer
:type indices: :class:`list`
.. method:: SetTemperature(temperature) .. method:: SetTemperature(temperature)
...@@ -453,15 +456,19 @@ Rotamer Groups ...@@ -453,15 +456,19 @@ Rotamer Groups
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
.. class:: RRMRotamerGroup(rotamers) .. class:: RRMRotamerGroup(rotamers, residue_index)
The RRMRotamerGroup groups several :class:`RRMRotamer` objects for the same The RRMRotamerGroup groups several :class:`RRMRotamer` objects for the same
residue position. It can either be constructed by providing a list of residue position.
:class:`RRMRotamer` objects or by convenience functions provided by PROMOD3.
:param rotamers: A list of :class:`RRMRotamer` objects :param rotamers: A list of :class:`RRMRotamer` objects
:param residue_index: Location of residue this :class:`FRMRotamerGroup`
represents. This index is important when calculating
frame energies to neglect the interactions to frame
particles of the same residue.
:type rotamers: :class:`list` :type rotamers: :class:`list`
:type residue_index: :class:`int`
:raises: :exc:`~exceptions.RuntimeError` if provided *rotamers* is empty :raises: :exc:`~exceptions.RuntimeError` if provided *rotamers* is empty
...@@ -512,10 +519,21 @@ Rotamer Groups ...@@ -512,10 +519,21 @@ Rotamer Groups
:type other: :class:`RRMRotamerGroup` :type other: :class:`RRMRotamerGroup`
.. method:: SetFrameEnergy(frame)
Calculates sets the energy of all rotamers in the group towards the
given **frame**.
.. method:: CalculateInternalEnergies() :param frame: Frame containing rigid particles
:type frame: :class:`Frame`
Calculates internal energies of all rotamers in group .. method:: AddFrameEnergy(frame)
Calculates adds the energy of all rotamers in the group towards the
given **frame**.
:param frame: Frame containing rigid particles
:type frame: :class:`Frame`
.. method:: ApplySelfEnergyThresh(thresh=30) .. method:: ApplySelfEnergyThresh(thresh=30)
...@@ -523,15 +541,19 @@ Rotamer Groups ...@@ -523,15 +541,19 @@ Rotamer Groups
rotamers with *self_energy* > *l_e* + *thresh* rotamers with *self_energy* > *l_e* + *thresh*
.. class:: FRMRotamerGroup(rotamers) .. class:: FRMRotamerGroup(rotamers, residue_index)
The FRMRotamerGroup groups several :class:`FRMRotamer` objects for the same The FRMRotamerGroup groups several :class:`FRMRotamer` objects for the same
residue position. It can either be constructed by providing a list of residue position.
:class:`FRMRotamer` objects or by convenience functions provided by PROMOD3.
:param rotamers: A list of :class:`FRMRotamer` objects :param rotamers: A list of :class:`FRMRotamer` objects
:param residue_index: Location of residue this :class:`FRMRotamerGroup`
represents. This index is important when calculating
frame energies to neglect the interactions to frame
particles of the same residue.
:type rotamers: :class:`list` :type rotamers: :class:`list`
:type residue_index: :class:`int`
:raises: :exc:`~exceptions.RuntimeError` if provided *rotamers* is empty :raises: :exc:`~exceptions.RuntimeError` if provided *rotamers* is empty
...@@ -582,238 +604,23 @@ Rotamer Groups ...@@ -582,238 +604,23 @@ Rotamer Groups
:type other: :class:`FRMRotamerGroup` :type other: :class:`FRMRotamerGroup`
.. method:: SetFrameEnergy(frame)
.. method:: CalculateInternalEnergies() Calculates sets the energy of all rotamers in the group towards the
given **frame**.
Calculates internal energies of all rotamers in group
.. method:: ApplySelfEnergyThresh(thresh=30)
Searches rotamer with lowest self energy *l_e* and deletes all
rotamers with *self_energy* > *l_e* + *thresh*
:param frame: Frame containing rigid particles
:type frame: :class:`Frame`
.. method:: AddFrameEnergy(frame)
Calculates adds the energy of all rotamers in the group towards the
given **frame**.
:param frame: Frame containing rigid particles
:type frame: :class:`Frame`
Convenient functions for constructing rotamers .. method:: ApplySelfEnergyThresh(thresh=30)
--------------------------------------------------------------------------------
For convenience, |project| offers some functionality to directly build single
rotamers or groups (see :ref:`below <rotamer_group_construction_label>`).
.. method:: ConstructRRMRotamer(n_pos, ca_pos, cb_pos, rotamer_id, settings, \
probability, chi1=NaN, chi2=NaN, chi3=NaN, \
chi4=NaN)
ConstructRRMRotamer(residue, rotamer_id, settings, probability, \
chi1=NaN, chi2=NaN, chi3=NaN, chi4=NaN)
:param n_pos: Position of nitrogen used as anchor for the rotamer
:param ca_pos: Position of alpha carbon used as anchor for the rotamer
:param cb_pos: Position of beta carbon used as anchor for the rotamer
:param residue: Residue from which the anchor positions will be
extracted
:param rotamer_id: Type of :class:`RRMRotamer`
:param settings: Settings to control parametrization of the single
particles.
:param probability: Probability of occurence of this particular rotamer.
:param chi1: First sidechain dihedral angle
:param chi2: Second sidechain dihedral angle
:param chi3: Third sidechain dihedral angle
:param chi4: Fourth sidechain dihedral angle
:type n_pos: :class:`ost.geom.Vec3`
:type ca_pos: :class:`ost.geom.Vec3`
:type cb_pos: :class:`ost.geom.Vec3`
:type residue: :class:`ost.mol.ResideHandle`
:type rotamer_id: :class:`RotamerID`
:type settings: :class:`RotamerSettings`
:type probability: :class:`float`
:type chi1: :class:`float`
:type chi2: :class:`float`
:type chi3: :class:`float`
:type chi4: :class:`float`
:returns: :class:`RRMRotamer`
:raises: :exc:`~exceptions.RuntimeError` if not all required chi angles
for this particular *id* are given or when not all required
anchor atoms are present in *residue*.
.. method:: ConstructFRMRotamer(n_pos, ca_pos, cb_pos, rotamer_id, settings, \
probability, chi1=NaN, sig1=NaN, chi2=NaN, \
sig2=NaN, chi3=NaN, sig3=NaN, chi4=NaN, \
sig4=NaN)
ConstructFRMRotamer(residue, rotamer_id, settings, probability, \
chi1=NaN, sig1=NaN, chi2=NaN, sig2=NaN, \
chi3=NaN, sig3=NaN, chi4=NaN, sig4=NaN)
:param n_pos: Position of nitrogen used as anchor for the rotamer
:param ca_pos: Position of alpha carbon used as anchor for the rotamer
:param cb_pos: Position of beta carbon used as anchor for the rotamer
:param residue: Residue from which the anchor positions will be
extracted
:param rotamer_id: Type of :class:`FRMRotamer`
:param settings: Settings to control parametrization of the single
particles.
:param probability: Probability of occurence of this particular rotamer.
:param chi1: First sidechain dihedral angle
:param sig1: Standard deviation of first dihedral angle
:param chi2: Second sidechain dihedral angle
:param sig2: Standard deviation of second dihedral angle
:param chi3: Third sidechain dihedral angle
:param sig3: Standard deviation of third dihedral angle
:param chi4: Fourth sidechain dihedral angle
:param sig4: Standard deviation of fourth dihedral angle
:type n_pos: :class:`ost.geom.Vec3`
:type ca_pos: :class:`ost.geom.Vec3`
:type cb_pos: :class:`ost.geom.Vec3`
:type residue: :class:`ost.mol.ResideHandle`
:type rotamer_id: :class:`RotamerID`
:type settings: :class:`RotamerSettings`
:type probability: :class:`float`
:type chi1: :class:`float`
:type sig1: :class:`float`
:type chi2: :class:`float`
:type sig2: :class:`float`
:type chi3: :class:`float`
:type sig3: :class:`float`
:type chi4: :class:`float`
:type sig4: :class:`float`
:returns: :class:`FRMRotamer`
:raises: :exc:`~exceptions.RuntimeError` if not all required chi angles
or standard deviations for this particular *id* are given or when
not all required anchor atoms are present in *residue*.
Convenient functions for constructing rotamer groups
--------------------------------------------------------------------------------
Instead of building single rotamers, following convenient functions query a
rotamer library and build all possible rotamers for a particular residue
position. If hbond scoring is enabled and *sample_polar_hydrogens* is true (in
*settings*), several rotamers might be constructed and added to the group per
library instance:
#. SER construct three rotamers with hydrogen chi angles 180, -60 and 60
#. THR construct three rotamers with hydrogen chi angles 180, -60 and 60
#. TYR construct two rotamers with hydrogen chi angles 180 and 0
#. HIS construct both possible protonation states (HSE,HSD)
.. _rotamer_group_construction_label:
.. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, rotamer_id, \
residue_index, bbdep_rot_lib, settings, \
phi=-1.0472, psi=-0.7854)
ConstructRRMRotamerGroup(residue, rotamer_id, residue_index, \
bbdep_rot_lib, settings, phi=-1.0472, \
psi=-0.7854)
ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, rotamer_id, \
residue_index, rot_lib, settings)
ConstructRRMRotamerGroup(residue, rotamer_id, residue_index, \
rot_lib, settings)
Constructs a full group of :class:`RRMRotamer` objects. It extracts rotamers
from a rotamer library and adds them to the group until the summed probability
reaches the probability cutoff defined in *settings*.
:param n_pos: Position of nitrogen used as anchor for the rotamers
:param ca_pos: Position of alpha carbon used as anchor for the rotamers
:param cb_pos: Position of beta carbon used as anchor for the rotamers
:param residue: Residue from which the anchor positions will be
extracted
:param rotamer_id: Type of of the constructed rotamers
:param residue_index: Index of rotamer in constructed rotamer group. This
matters for calculating the frame energy. Interactions
to frame residues with same index get neglected.
:param bbdep_rot_lib: Backbone dependent rotamer library from which the data
is taken to construct the rotamers.
:param rot_lib: Non-backbone-dependent rotamer library from which the
data is taken to construct the rotamers.
:param settings: Settings to control parametrization of the single
particles.
:param phi: Phi backbone dihedral angle used as input for backbone
dependent rotamer library. Default value is a typical
alpha helical value.
:param psi: Psi backbone dihedral angle used as input for backbone
dependent rotamer library. Default value is a typical
alpha helical value.
:type n_pos: :class:`ost.geom.Vec3`
:type ca_pos: :class:`ost.geom.Vec3`
:type cb_pos: :class:`ost.geom.Vec3`
:type residue: :class:`ost.mol.ResideHandle`
:type rotamer_id: :class:`RotamerID`
:type residue_index: :class:`int`
:type bbdep_rot_lib: :class:`BBDepRotamerLib`
:type rot_lib: :class:`RotamerLib`
:type settings: :class:`RotamerSettings`
:type phi: :class:`float`
:type psi: :class:`float`
:returns: :class:`RRMRotamerGroup`
:raises: :exc:`~exceptions.RuntimeError` if not all required anchor atoms
are present in *residue*.
.. method:: ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos, rotamer_id, \
residue_index, bbdep_rot_lib, settings, \
phi=-1.0472, psi=-0.7854)
ConstructFRMRotamerGroup(residue, rotamer_id, residue_index, \
bbdep_rot_lib, settings, phi=-1.0472, \
psi=-0.7854)
ConstructFRMRotamerGroup(n_pos, ca_pos, cb_pos, rotamer_id, \
residue_index, rot_lib, settings)
ConstructFRMRotamerGroup(residue, rotamer_id, residue_index, \
rot_lib, settings)
Constructs a full group of :class:`RRMRotamer` objects. It extracts rotamers
from a rotamer library and adds them to the group until the summed probability
reaches the probability cutoff defined in *settings*.
:param n_pos: Position of nitrogen used as anchor for the rotamers
:param ca_pos: Position of alpha carbon used as anchor for the rotamers
:param cb_pos: Position of beta carbon used as anchor for the rotamers
:param residue: Residue from which the anchor positions will be
extracted
:param rotamer_id: Type of of the constructed rotamers
:param residue_index: Index of rotamer in constructed rotamer group. This
matters for calculating the frame energy. Interactions
to frame residues with same index get neglected.
:param bbdep_rot_lib: Backbone dependent rotamer library from which the data
is taken to construct the rotamers.
:param rot_lib: Non-backbone-dependent rotamer library from which the
data is taken to construct the rotamers.
:param settings: Settings to control parametrization of the single
particles.
:param phi: Phi backbone dihedral angle used as input for backbone
dependent rotamer library. Default value is a typical
alpha helical value.
:param psi: Psi backbone dihedral angle used as input for backbone
dependent rotamer library. Default value is a typical
alpha helical value.
:type n_pos: :class:`ost.geom.Vec3`
:type ca_pos: :class:`ost.geom.Vec3`
:type cb_pos: :class:`ost.geom.Vec3`
:type residue: :class:`ost.mol.ResideHandle`
:type rotamer_id: :class:`RotamerID`
:type residue_index: :class:`int`
:type bbdep_rot_lib: :class:`BBDepRotamerLib`
:type rot_lib: :class:`RotamerLib`
:type settings: :class:`RotamerSettings`
:type phi: :class:`float`
:type psi: :class:`float`
:returns: :class:`FRMRotamerGroup`
:raises: :exc:`~exceptions.RuntimeError` if not all required anchor atoms Searches rotamer with lowest self energy *l_e* and deletes all
are present in *residue*. rotamers with *self_energy* > *l_e* + *thresh*
\ No newline at end of file
Rotamer Constructor
================================================================================
.. currentmodule:: promod3.sidechain
Instead of creating rotamers by yourself, you can simply use the convenient
functionality provided by PROMOD3
Constructing Rotamers and Frame Residues
--------------------------------------------------------------------------------
.. class:: SCWRLRotamerConstructor()
Constructing rotamers and frame residues that are parametrized according to
the SCWRL4 method. They contain all heavy atoms, but also the
polar hydrogens. The rotamers start after the CB atom (typically CG).
In case of the :class:`FrameResidue` construction, the
constructor distinguishes between backbone and sidechain frame residues.
.. method:: ConstructRRMRotamerGroup(res, id, residue_index, rot_lib,\
[probability_cutoff = 0.98])
.. method:: ConstructRRMRotamerGroup(all_atom_pos, aa_res_idx, id,\
residue_index, rot_lib,\
[probability_cutoff = 0.98])
.. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, id,\
residue_index, rot_lib,\
[probability_cutoff = 0.98])
.. method:: ConstructRRMRotamerGroup(res, id, residue_index, rot_lib,\
[phi = -1.0472, psi = -0.7854,\
probability_cutoff = 0.98])
.. method:: ConstructRRMRotamerGroup(all_atom_pos, aa_res_idx, id,\
residue_index, rot_lib,\
[phi = -1.0472, psi = -0.7854,\
probability_cutoff = 0.98])
.. method:: ConstructRRMRotamerGroup(n_pos, ca_pos, cb_pos, id,\
residue_index, rot_lib,\
[phi = -1.0472, psi = -0.7854,\
probability_cutoff = 0.98])
All functions are also avaible for their flexible rotamer model counterpart.
=>ConstructFRMRotamerGroup(...) with exactly the same parameters.
:param res: To extract the N, CA, CB backbone anchor
:param all_atom_pos: To extract the N, CA, CB backbone anchor
:param aa_res_idx: Index of residue in **all_atom_pos** from which to
extract the backbone anchor
:param n_pos: To directly feed in the backbone anchor positions
:param ca_pos: To directly feed in the backbone anchor positions
:param cb_pos: To directly feed in the backbone anchor positions
:param id: Identifies the sidechain.
:param residue_index: Important for the energy calculations towards the
:class:`Frame` you don't want to calculate a pairwise
energy of the sidechain particles towards particles
representing the own backbone...
:param rot_lib: To search for rotamers
:param phi: Phi dihedral angle used to search for rotamers if a
:class:`BBDepRotamerLib` is given as input
:param psi: Psi dihedral angle used to search for rotamers if a
:class:`BBDepRotamerLib` is given as input
:param probability_cutoff: For some rotamers, there might be many low
probability entries in the library.
The function adds single rotamers to the group until
the cumulative probability of the added rotamers is
larger or equal **probability_cutoff**.
:returns: The rotamer group containing all constructed rotamers
with internal energies assigned based on the
probabilities extracted from the rotamer library.
:type res: :class:`ost.mol.ResidueHandle`
:type all_atom_pos: :class:`promod3.loop.AllAtomPositions`
:type aa_res_idx: :class:`int`
:type n_pos: :class:`ost.geom.Vec3`
:type ca_pos: :class:`ost.geom.Vec3`
:type cb_pos: :class:`ost.geom.Vec3`
:type id: :class:`RotamerID`
:type residue_index: :class:`int`
:type rot_lib: :class:`RotamerLib` / :class:`BBDepRotamerLib`
:type probability_cutoff: :class:`float`
:rtype: :class:`RRMRotamerGroup`
:raises: :exc:`~exceptions.RuntimeError` when not all required backbone
atoms are present in **residue**, not all required atom
positions are set in **all_atom_pos** or when the rotamer library
does not contain any entries for **id**
.. method:: ConstructBackboneFrameResidue(res, id, residue_index, Real phi,\
[n_ter = False, c_ter = False])
.. method:: ConstructBackboneFrameResidue(all_atom_pos, aa_res_idx, id,\
residue_index, Real phi,\
[n_ter = False, c_ter = False])
.. method:: ConstructBackboneFrameResidue(n_pos, ca_pos, c_pos, o_pos, cb_pos,\
id, residue_index, Real phi,\
[n_ter = False, c_ter = False])
Constructs backbone frame residues for amino acid residues. It extracts
the n, ca, c, o and cb positions and constructs a frame residue based on
the parametrizations of SCWRL4. In case of **n_ter**, there are additional
hydrogens added at the nitrogen to represent a proper n-terminus. The same
is true for **c_ter**, an additional oxygen is built instead. In any case,
a single hydrogen is added to the nitrogen (except proline), this is
why the phi angle of the residue is required as an input.
:param res: Residue from which to extract the backbone positions
:param all_atom_pos: To extract the backbone positions
:param aa_res_idx: Index of residue in **all_atom_pos** from which to
extract the backbone positions
:param n_pos: To directly feed in the backbone positions
:param ca_pos: To directly feed in the backbone positions
:param c_pos: To directly feed in the backbone positions
:param o_pos: To directly feed in the backbone positions
:param cb_pos: To directly feed in the backbone positions
:param id: Identifies the sidechain
:param residue_index: Important for the energy calculations towards the
:class:`Frame` you don't want to calculate a pairwise
energy of the sidechain particles towards particles
representing the own backbone...
:param phi: The dihedral angle of the current residue, required to
construct the polar nitrogen hydrogen
:param n_ter: Whether to add additional hydrogens at the nitrogen
to represent a proper n-terminus
:param c_ter: Whether to add an additional oxygen at the carbon to
represent a proper c-terminus
:type res: :class:`ost.mol.ResidueHandle`
:type all_atom_pos: :class:`promod3.loop.AllAtomPositions`
:type aa_res_idx: :class:`int`
:type n_pos: :class:`ost.geom.Vec3`
:type ca_pos: :class:`ost.geom.Vec3`
:type c_pos: :class:`ost.geom.Vec3`
:type o_pos: :class:`ost.geom.Vec3`
:type cb_pos: :class:`ost.geom.Vec3`
:type id: :class:`RotamerID`
:type residue_index: :class:`int`
:type phi: :class:`float`
:type n_ter: :class:`bool`
:type c_ter: :class:`bool`
:rtype: :class:`FrameResidue`
:raises: :exc:`~exceptions.RuntimeError` when not all required backbone
atoms are present in **residue**, not all required atom
positions are set in **all_atom_pos**.
.. method:: ConstructSidechainFrameResidue(res, id, residue_index)
.. method:: ConstructSidechainFrameResidue(all_atom, aa_res_idx, id,\
residue_index)
Extracts all required positions from the input and generates a sidechain
frame residue. Additionally to the heavy atoms, the function also produces
particles for all polar hydrogens.
:param res: Residue from which to extract the sidechain positions
:param all_atom_pos: To extract the sidechain positions
:param aa_res_idx: Index of residue in **all_atom_pos** from which to
extract the sidechain positions
:param id: Identifies the sidechain
:param residue_index: idenfifies residue in frame
:type res: :class:`ost.mol.ResidueHandle`
:type all_atom_pos: :class:`promod3.loop.AllAtomPositions`
:type aa_res_idx: :class:`int`
:type id: :class:`RotamerID`
:type residue_index: :class:`int`
:rtype: :class:`FrameResidue`
:raises: :exc:`~exceptions.RuntimeError` when not all required sidechain
atoms are present in **residue** or not all required sidechain
atom positions are set in **all_atom_pos**.
.. method:: AssignInternalEnergies(rot_group)
Takes the rotamer group and assigns every single rotamer its internal
energy based on the probabilistic approach used by SCWRL4.
=> -internal_e_prefac*log(p/max_p), where internal_e_prefac and p are
rotamer specific and max_p is the maximum probablity of any of the rotamers
in **rot_group**. If you construct a rotamer group by the
ConstructRRMRotamerGroup/ConstructFRMRotamerGroup functions, this function
is already called at construction and the energies are properly assigned.
Rotamer Settings
================================================================================
.. currentmodule:: promod3.sidechain
The rotamer settings control the sidechain modelling algorithms at different
stages. Most of the parameters that can be set are related to the flexible
rotamer model (temperature factor and delta factors to control the
variability of the subrotamers in the flexible rotamer model)
or the internal energy prefactor used for the different amino
acids. Other parameters include the radius influencing the pseudo Lennard
Jones term for the different atom types and the max interaction radius.
The max interaction radius is more a technical thing and is used by a
collision detection algorithm to define the collision distance, i.e.
two particles with max radii a,b collide/interact if the distance between
them is smaller than a+b. The last three parameters control the buildup of the
rotamers. It is possible to deactivate the hbond term, resulting in
no hydrogens being constructed. The sampling of polar hydrogens can also
be controlled resulting in several rotamers per rotamer lib entry for
Ser,Thr and Tyr when using the convenient functions for constructing full
rotamer groups of them (see :ref:`here <rotamer_group_construction_label>`).
Constructing the rotamer groups can further be controlled by assigning a max
summed probability resulting in less very unlikely rotamers added to the
rotamer group (see :ref:`here <rotamer_group_construction_label>`).
.. class:: RotamerSettings
.. attribute:: FRM_T_ARG default: 1.23
.. attribute:: FRM_T_ASN default: 1.41
.. attribute:: FRM_T_ASP default: 1.48
.. attribute:: FRM_T_GLN default: 1.32
.. attribute:: FRM_T_GLU default: 0.94
.. attribute:: FRM_T_LYS default: 1.27
.. attribute:: FRM_T_SER default: 3.53
.. attribute:: FRM_T_CYS default: 1.69
.. attribute:: FRM_T_MET default: 1.77
.. attribute:: FRM_T_TRP default: 0.99
.. attribute:: FRM_T_TYR default: 1.96
.. attribute:: FRM_T_THR default: 1.11
.. attribute:: FRM_T_VAL default: 2.20
.. attribute:: FRM_T_ILE default: 2.03
.. attribute:: FRM_T_LEU default: 2.55
.. attribute:: FRM_T_PRO default: 2.62
.. attribute:: FRM_T_HIS default: 1.35
.. attribute:: FRM_T_PHE default: 1.07
.. attribute:: FRM_delta1_ARG default: 0.87
.. attribute:: FRM_delta2_ARG default: 1.62
.. attribute:: FRM_delta3_ARG default: 1.67
.. attribute:: FRM_delta4_ARG default: 0.78
.. attribute:: FRM_delta1_ASN default: 0.62
.. attribute:: FRM_delta2_ASN default: 1.93
.. attribute:: FRM_delta1_ASP default: 1.59
.. attribute:: FRM_delta2_ASP default: 0.63
.. attribute:: FRM_delta1_GLN default: 1.55
.. attribute:: FRM_delta2_GLN default: 0.68
.. attribute:: FRM_delta3_GLN default: 1.88
.. attribute:: FRM_delta1_GLU default: 0.82
.. attribute:: FRM_delta2_GLU default: 1.57
.. attribute:: FRM_delta3_GLU default: 0.78
.. attribute:: FRM_delta1_LYS default: 1.62
.. attribute:: FRM_delta2_LYS default: 0.99
.. attribute:: FRM_delta3_LYS default: 0.96
.. attribute:: FRM_delta4_LYS default: 1.48
.. attribute:: FRM_delta1_SER default: 0.65
.. attribute:: FRM_delta2_SER default: 2.98
.. attribute:: FRM_delta1_CYS default: 1.69
.. attribute:: FRM_delta1_MET default: 0.97
.. attribute:: FRM_delta2_MET default: 1.54
.. attribute:: FRM_delta3_MET default: 1.21
.. attribute:: FRM_delta1_TRP default: 1.28
.. attribute:: FRM_delta2_TRP default: 1.48
.. attribute:: FRM_delta1_TYR default: 1.48
.. attribute:: FRM_delta2_TYR default: 0.73
.. attribute:: FRM_delta3_TYR default: 0.96
.. attribute:: FRM_delta1_THR default: 0.88
.. attribute:: FRM_delta2_THR default: 0.88
.. attribute:: FRM_delta1_VAL default: 2.08
.. attribute:: FRM_delta1_ILE default: 1.23
.. attribute:: FRM_delta2_ILE default: 0.98
.. attribute:: FRM_delta1_LEU default: 1.15
.. attribute:: FRM_delta2_LEU default: 1.48
.. attribute:: FRM_delta1_PRO default: 0.78
.. attribute:: FRM_delta2_PRO default: 1.27
.. attribute:: FRM_delta1_HIS default: 1.84
.. attribute:: FRM_delta2_HIS default: 0.85
.. attribute:: FRM_delta1_PHE default: 1.45
.. attribute:: FRM_delta2_PHE default: 1.35
.. attribute:: internal_e_prefactor_ARG default: 2.27
.. attribute:: internal_e_prefactor_ASN default: 1.80
.. attribute:: internal_e_prefactor_ASP default: 2.44
.. attribute:: internal_e_prefactor_GLN default: 1.61
.. attribute:: internal_e_prefactor_GLU default: 1.85
.. attribute:: internal_e_prefactor_LYS default: 2.13
.. attribute:: internal_e_prefactor_SER default: 2.78
.. attribute:: internal_e_prefactor_CYS default: 4.07
.. attribute:: internal_e_prefactor_MET default: 1.95
.. attribute:: internal_e_prefactor_TRP default: 3.24
.. attribute:: internal_e_prefactor_TYR default: 2.00
.. attribute:: internal_e_prefactor_THR default: 2.96
.. attribute:: internal_e_prefactor_VAL default: 1.62
.. attribute:: internal_e_prefactor_ILE default: 2.18
.. attribute:: internal_e_prefactor_LEU default: 2.25
.. attribute:: internal_e_prefactor_PRO default: 0.76
.. attribute:: internal_e_prefactor_HIS default: 2.01
.. attribute:: internal_e_prefactor_PHE default: 1.71
.. attribute:: probability_cutoff default: 0.98
.. attribute:: consider_hbonds default: True
.. attribute:: sample_polar_hydrogens default: True
...@@ -377,7 +377,7 @@ def _GetDisulfidBridges(frame_residues, cystein_indices, res_list, rotamer_libra ...@@ -377,7 +377,7 @@ def _GetDisulfidBridges(frame_residues, cystein_indices, res_list, rotamer_libra
def Reconstruct(ent, keep_sidechains=False, build_disulfids=True, def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
rotamer_model="frm", consider_ligands=True, rotamer_model="frm", consider_ligands=True,
rotamer_library=None, rotamer_constructor=None): rotamer_library=None):
'''Reconstruct sidechains for the given structure. '''Reconstruct sidechains for the given structure.
:param ent: Structure for sidechain reconstruction. Note, that the :param ent: Structure for sidechain reconstruction. Note, that the
...@@ -431,7 +431,7 @@ def Reconstruct(ent, keep_sidechains=False, build_disulfids=True, ...@@ -431,7 +431,7 @@ def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
bbdep = False bbdep = False
if type(rotamer_library) is sidechain.BBDepRotamerLib: if type(rotamer_library) is sidechain.BBDepRotamerLib:
bbdep = True bbdep = True
if rotamer_constructor == None:
rotamer_constructor = sidechain.SCWRLRotamerConstructor() rotamer_constructor = sidechain.SCWRLRotamerConstructor()
# take out ligand chain and any non-peptides # take out ligand chain and any non-peptides
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment