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
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,8 @@ from promod3 import sidechain
prot = io.LoadPDB('data/1CRN.pdb')
# load rotamer library
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()
# create new entity from protein only containing the amino acids
......
......@@ -5,7 +5,7 @@ rotamer.rst
rotamer_id.rst
frame.rst
rotamer_lib.rst
sidechain_settings.rst
rotamer_constructor.rst
graph.rst
disulfid.rst
loading.rst
......
......@@ -17,9 +17,6 @@ The Frame Objects
--------------------------------------------------------------------------------
.. 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 residue_index: Interaction energies between the constructed frame
......@@ -47,30 +44,12 @@ The Frame Objects
.. class:: Frame(frame_residues)
The :class:`Frame` object allows to calculate frame energies for rotamers.
Due to technical reasons, this is only possible if the rotamers are
part of rotamer groups.
The :class:`Frame` object is used as a container for rigid particles, that
can be passed to rotamer groups for calculating frame energies.
:param frame_residues: residues building the frame.
: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
......
......@@ -19,20 +19,13 @@ and finally comes back with a solution.
.. 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)
:param rotamer_groups: :class:`FRMRotamerGroup` objects representing the
possible sidechain conformations for every amino
acid position.
:param rotamer_groups: :class:`RRMRotamerGroup` or :class:`FRMRotamerGroup`
objects representing the possible sidechain
conformations for every amino acid position.
:type rotamer_groups: :class:`list`
:type rotamer_groups: :class:`list`
.. method:: Prune(epsilon, [e_cut=0.0, consider_all_nodes=False])
......
......@@ -40,7 +40,10 @@ Contents:
rotamer
frame
rotamer_lib
rotamer_constructor
graph
sidechain_settings
disulfid
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]_ .
Loads the backbone independent Penultimate library. The values for the dihedral
angles are directly extracted from the publication without considering the
probabilities specifically for helices/sheets. Due to no assigned standard
deviations, the flexible rotamer model won't work.
probabilities specific for helices/sheets. Due to no assigned standard
deviations, the flexible rotamer model won't produce meaningful results.
:returns: The requested library
:rtype: :class:`RotamerLib`
......@@ -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
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.
:param filename: Name of the file
......@@ -51,8 +51,6 @@ the backbone independent Penultimate library [lovell2000]_ .
: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.
.. [lovell2000] Lovell SC, Word JM, Richardson JS, Richardson DC (2000). The penultimate rotamer library. Proteins.
......
This diff is collapsed.
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
def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
rotamer_model="frm", consider_ligands=True,
rotamer_library=None, rotamer_constructor=None):
rotamer_library=None):
'''Reconstruct sidechains for the given structure.
:param ent: Structure for sidechain reconstruction. Note, that the
......@@ -431,8 +431,8 @@ def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
bbdep = False
if type(rotamer_library) is sidechain.BBDepRotamerLib:
bbdep = True
if rotamer_constructor == None:
rotamer_constructor = sidechain.SCWRLRotamerConstructor()
rotamer_constructor = sidechain.SCWRLRotamerConstructor()
# take out ligand chain and any non-peptides
prot = ent.Select("peptide=true and cname!='_'")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment