OpenStructure
Loading...
Searching...
No Matches
Data Structures | Functions
ost.mol.alg.qsscoring Namespace Reference

Data Structures

class  _CachedRMSD
 
class  MappedLDDTScorer
 
class  OligoLDDTScorer
 
class  QSscoreEntity
 
class  QSscoreError
 
class  QSscorer
 

Functions

 FilterContacts (contacts, chain_names)
 
 GetContacts (entity, calpha_only, dist_thr=12.0)
 
 _AlignAtomSeqs (seq_1, seq_2)
 
 _FixSelectChainNames (ch_names)
 
 _CleanInputEntity (ent)
 
 _GetCAOnlyEntity (ent)
 
 _GetChemGroups (qs_ent, seqid_thr=95.)
 
 _GetAngles (Rt)
 
 _GetChemGroupsMapping (qs_ent_1, qs_ent_2)
 
 _SelectFew (l, max_elements)
 
 _GetAlignedResidues (qs_ent_1, qs_ent_2, chem_mapping, max_ca_per_chain, clustalw_bin)
 
 _FindSymmetry (qs_ent_1, qs_ent_2, ent_to_cm_1, ent_to_cm_2, chem_mapping)
 
 _GetChainMapping (ent_1, ent_2, symm_1, symm_2, chem_mapping, max_mappings_extensive)
 
 _GetSymmetrySubgroups (qs_ent, ent, chem_groups)
 
 _GetDihedralSubgroups (ent, chem_groups, angles, angle_thr)
 
 _GetCyclicSubgroups (ent, chem_groups, axis, axis_thr)
 
 _ClusterData (data, thr, metric)
 
 _AngleArrayDistance (u, v)
 
 _AxisDistance (u, v)
 
 _GetClosestChain (ent, ref_chain, chains)
 
 _GetClosestChainInterface (ent, ref_chain, chains)
 
 _ValidChainGroup (group, ent)
 
 _LimitChemMapping (chem_mapping, limit_1, limit_2)
 
 _CountSuperpositionsAndMappings (symm_1, symm_2, chem_mapping)
 
 _PermutationOrCombinations (sup1, sup2, chem_mapping)
 
 _ListPossibleMappings (sup1, sup2, chem_mapping)
 
 _CheckClosedSymmetry (ent_1, ent_2, symm_1, symm_2, chem_mapping, sup_thr=4, sup_fract=0.8, find_best=True)
 
 _GetSuperpositionMapping (ent_1, ent_2, chem_mapping, transformation, sup_thr, sup_fract)
 
 _GetMappedRMSD (ent_1, ent_2, chain_mapping, transformation)
 
 _CleanUserSymmetry (symm, ent)
 
 _AreValidSymmetries (symm_1, symm_2)
 
 _GetMappedAlignments (ent_1, ent_2, chain_mapping, res_num_alignment)
 
 _GetMappedResidues (alns)
 
 _GetExtraWeights (contacts, done, mapped_residues)
 
 _GetScores (contacts_1, contacts_2, mapped_residues, chain_mapping)
 
 _weight (dist)
 
 _GetQsSuperposition (alns)
 
 _AddResidue (edi, res, rnum, chain, calpha_only)
 
 _MergeAlignedChains (alns, ent_1, ent_2, calpha_only, penalize_extra_chains)
 

Detailed Description

Scoring of quaternary structures (QS). The QS scoring is according to the paper
by `Bertoni et al. <https://dx.doi.org/10.1038/s41598-017-09654-8>`_.

.. warning::

  The `qsscoring` module is deprecated. Consider using the newer implementation
  in :mod:`~ost.mol.alg.qsscore` instead.

.. note ::

  Requirements for use:

  - A default :class:`compound library <ost.conop.CompoundLib>` must be defined
    and accessible via :func:`~ost.conop.GetDefaultLib`. This is set by default
    when executing scripts with ``ost``. Otherwise, you must set this with
    :func:`~ost.conop.SetDefaultLib`.
  - ClustalW must be installed (unless you provide chain mappings)
  - Python modules `numpy` and `scipy` must be installed and available
    (e.g. use ``pip install scipy numpy``)

Function Documentation

◆ _AddResidue()

_AddResidue (   edi,
  res,
  rnum,
  chain,
  calpha_only 
)
protected
Add residue *res* with res. num. *run* to given *chain* using editor *edi*.
Either all atoms added or (if *calpha_only*) only CA.

Definition at line 2899 of file qsscoring.py.

◆ _AlignAtomSeqs()

_AlignAtomSeqs (   seq_1,
  seq_2 
)
protected
:type seq_1: :class:`ost.seq.SequenceHandle`
:type seq_2: :class:`ost.seq.SequenceHandle`
:return: Alignment of two sequences using a global alignment. Views attached
         to the input sequences will remain attached in the aln.
:rtype:  :class:`~ost.seq.AlignmentHandle` or None if it failed.

Definition at line 1481 of file qsscoring.py.

◆ _AngleArrayDistance()

_AngleArrayDistance (   u,
  v 
)
protected
:return: Average angular distance of two arrays of angles.
:param u: Euler angles.
:param v: Euler angles.

Definition at line 2155 of file qsscoring.py.

◆ _AreValidSymmetries()

_AreValidSymmetries (   symm_1,
  symm_2 
)
protected
Check symmetry pair for major problems.

:return: False if any of the two is empty or if they're compatible in size.
:rtype:  :class:`bool`

Definition at line 2664 of file qsscoring.py.

◆ _AxisDistance()

_AxisDistance (   u,
  v 
)
protected
:return: Euclidean distance between two rotation axes. Axes can point in
         either direction so we ensure to use the closer one.
:param u: Rotation axis.
:param v: Rotation axis.

Definition at line 2169 of file qsscoring.py.

◆ _CheckClosedSymmetry()

_CheckClosedSymmetry (   ent_1,
  ent_2,
  symm_1,
  symm_2,
  chem_mapping,
  sup_thr = 4,
  sup_fract = 0.8,
  find_best = True 
)
protected
Quick check if we can superpose two chains and get a mapping for all other
chains using the same transformation. The mapping is defined by sufficient
overlap of the transformed chain of *ent_1* onto another chain in *ent_2*.

:param ent_1: Entity to map to *ent_2* (perfect alignment assumed between
              chains of same chem. group as in :attr:`QSscorer.ent_to_cm_1`).
              Views are ok but only to select full chains!
:param ent_2: Entity to map to (perfect alignment assumed between
              chains of same chem. group as in :attr:`QSscorer.ent_to_cm_2`).
              Views are ok but only to select full chains!
:param symm_1: Symmetry groups to use. We only superpose chains within
               reference symmetry group of *symm_1* and *symm_2*.
               See :attr:`QSscorer.symm_1`
:param symm_2: See :attr:`QSscorer.symm_2`
:param chem_mapping: See :attr:`QSscorer.chem_mapping`.
                     All chains in *ent_1* / *ent_2* must be listed here!
:param sup_thr: Distance around transformed chain in *ent_1* to check for
                overlap.
:type sup_thr:  :class:`float`
:param sup_fract: Fraction of atoms in chain of *ent_2* that must be
                  overlapped for overlap to be sufficient.
:type sup_fract:  :class:`float`
:param find_best: If True, we look for best mapping according to
                  :func:`_GetMappedRMSD`. Otherwise, we return first suitable
                  mapping.
:type find_best:  :class:`bool`

:return: Mapping from *ent_1* to *ent_2* or None if none found. Mapping, if
         found, is as in :attr:`QSscorer.chain_mapping`.
:rtype:  :class:`dict` (:class:`str` / :class:`str`)

Definition at line 2385 of file qsscoring.py.

◆ _CleanInputEntity()

_CleanInputEntity (   ent)
protected
:param ent: The OST entity to be cleaned.
:type ent:  :class:`EntityHandle` or :class:`EntityView`
:return: A tuple of 3 items: :attr:`QSscoreEntity.ent`,
                             :attr:`QSscoreEntity.removed_chains`,
                             :attr:`QSscoreEntity.calpha_only`

Definition at line 1511 of file qsscoring.py.

◆ _CleanUserSymmetry()

_CleanUserSymmetry (   symm,
  ent 
)
protected
Clean-up user provided symmetry.

:param symm: Symmetry group as in :attr:`QSscorer.symm_1`
:param ent: Entity from which to extract chain names
:type ent:  :class:`~ost.mol.EntityHandle` or :class:`~ost.mol.EntityView`
:return: New symmetry group limited to chains in sub-structure *ent*
         (see :attr:`QSscorer.symm_1`). Empty list if invalid symmetry.

Definition at line 2626 of file qsscoring.py.

◆ _ClusterData()

_ClusterData (   data,
  thr,
  metric 
)
protected
Wrapper for fclusterdata to get dict of clusters.

:param data: :class:`dict` (keys for ID, values used for clustering)
:return: :class:`dict` {cluster_idx: {data-key: data-value}}

Definition at line 2134 of file qsscoring.py.

◆ _CountSuperpositionsAndMappings()

_CountSuperpositionsAndMappings (   symm_1,
  symm_2,
  chem_mapping 
)
protected
:return: Dictionary of number of mappings and superpositions to be performed.
         Returned as *result[X][Y] = number* with X = "intra" or "inter" and
         Y = "mappings" or "superpositions". The idea is that for each
         pairwise superposition we check all possible mappings.
         We can check the combinations within (intra) a symmetry group and
         once established, we check the combinations between different (inter)
         symmetry groups.
:param symm_1: See :attr:`QSscorer.symm_1`
:param symm_2: See :attr:`QSscorer.symm_2`
:param chem_mapping: See :attr:`QSscorer.chem_mapping`

Definition at line 2260 of file qsscoring.py.

◆ _FindSymmetry()

_FindSymmetry (   qs_ent_1,
  qs_ent_2,
  ent_to_cm_1,
  ent_to_cm_2,
  chem_mapping 
)
protected
:return: A pair of comparable symmetry groups (for :attr:`QSscorer.symm_1`
         and :attr:`QSscorer.symm_2`) between the two structures.
         Empty lists if no symmetry identified.

:param qs_ent_1: See :attr:`QSscorer.qs_ent_1`
:param qs_ent_2: See :attr:`QSscorer.qs_ent_2`
:param ent_to_cm_1: See :attr:`QSscorer.ent_to_cm_1`
:param ent_to_cm_2: See :attr:`QSscorer.ent_to_cm_2`
:param chem_mapping: See :attr:`QSscorer.chem_mapping`

Definition at line 1792 of file qsscoring.py.

◆ _FixSelectChainNames()

_FixSelectChainNames (   ch_names)
protected
:return: String to be used with Select(cname=<RETURN>). Takes care of joining
         and putting quotation marks where needed.
:rtype:  :class:`str`
:param ch_names: Some iterable list of chain names (:class:`str` items).

Definition at line 1500 of file qsscoring.py.

◆ _GetAlignedResidues()

_GetAlignedResidues (   qs_ent_1,
  qs_ent_2,
  chem_mapping,
  max_ca_per_chain,
  clustalw_bin 
)
protected
:return: Tuple of two :class:`~ost.mol.EntityView` objects containing subsets
         of *qs_ent_1* and *qs_ent_2*. Two entities are later created from
         those views (see :attr:`QSscorer.ent_to_cm_1` and
         :attr:`QSscorer.ent_to_cm_2`)

:param qs_ent_1: See :attr:`QSscorer.qs_ent_1`
:param qs_ent_2: See :attr:`QSscorer.qs_ent_2`
:param chem_mapping: See :attr:`QSscorer.chem_mapping`
:param max_ca_per_chain: See :attr:`QSscorer.max_ca_per_chain_for_cm`

Definition at line 1726 of file qsscoring.py.

◆ _GetAngles()

_GetAngles (   Rt)
protected
Computes the Euler angles given a transformation matrix.

:param Rt: Rt operator.
:type Rt:  :class:`ost.geom.Mat4`
:return: A :class:`tuple` of angles for each axis (x,y,z)

Definition at line 1619 of file qsscoring.py.

◆ _GetCAOnlyEntity()

_GetCAOnlyEntity (   ent)
protected
:param ent: Entity to process
:type ent:  :class:`EntityHandle` or :class:`EntityView`
:return: New entity with only CA and only one atom per residue
         (see :attr:`QSscoreEntity.ca_entity`)

Definition at line 1552 of file qsscoring.py.

◆ _GetChainMapping()

_GetChainMapping (   ent_1,
  ent_2,
  symm_1,
  symm_2,
  chem_mapping,
  max_mappings_extensive 
)
protected
:return: Tuple with mapping from *ent_1* to *ent_2* (see
         :attr:`QSscorer.chain_mapping`) and scheme used (see
         :attr:`QSscorer.chain_mapping_scheme`)

:param ent_1: See :attr:`QSscorer.ent_to_cm_1`
:param ent_2: See :attr:`QSscorer.ent_to_cm_2`
:param symm_1: See :attr:`QSscorer.symm_1`
:param symm_2: See :attr:`QSscorer.symm_2`
:param chem_mapping: See :attr:`QSscorer.chem_mapping`
:param max_mappings_extensive: See :attr:`QSscorer.max_mappings_extensive`

Definition at line 1850 of file qsscoring.py.

◆ _GetChemGroups()

_GetChemGroups (   qs_ent,
  seqid_thr = 95. 
)
protected
:return: Intra-complex group of chemically identical polypeptide chains
         (see :attr:`QSscoreEntity.chem_groups`)

:param qs_ent: Entity to process
:type qs_ent:  :class:`QSscoreEntity`
:param seqid_thr: Threshold used to decide when two chains are identical.
                  95 percent tolerates the few mutations crystallographers
                  like to do.
:type seqid_thr:  :class:`float`

Definition at line 1569 of file qsscoring.py.

◆ _GetChemGroupsMapping()

_GetChemGroupsMapping (   qs_ent_1,
  qs_ent_2 
)
protected
:return: Inter-complex mapping of chemical groups
         (see :attr:`QSscorer.chem_mapping`)

:param qs_ent_1: See :attr:`QSscorer.qs_ent_1`
:param qs_ent_2: See :attr:`QSscorer.qs_ent_2`

Definition at line 1640 of file qsscoring.py.

◆ _GetClosestChain()

_GetClosestChain (   ent,
  ref_chain,
  chains 
)
protected
:return: Chain closest to *ref_chain* based on center of atoms distance.
:rtype:  :class:`str`
:param ent: See :func:`_GetSymmetrySubgroups`
:param ref_chain: We look for chains closest to this one
:type ref_chain:  :class:`str`
:param chains: We only consider these chains
:type chains:  :class:`list` of :class:`str`

Definition at line 2186 of file qsscoring.py.

◆ _GetClosestChainInterface()

_GetClosestChainInterface (   ent,
  ref_chain,
  chains 
)
protected
:return: Chain with biggest interface (within 10 A) to *ref_chain*.
:rtype:  :class:`str`
:param ent: See :func:`_GetSymmetrySubgroups`
:param ref_chain: We look for chains closest to this one
:type ref_chain:  :class:`str`
:param chains: We only consider these chains
:type chains:  :class:`list` of :class:`str`

Definition at line 2204 of file qsscoring.py.

◆ _GetCyclicSubgroups()

_GetCyclicSubgroups (   ent,
  chem_groups,
  axis,
  axis_thr 
)
protected
:return: Cyclic subgroups for :func:`_GetSymmetrySubgroups`
         (same return type as there). Empty list if fail.

:param ent: See :func:`_GetSymmetrySubgroups`
:param chem_groups: See :func:`_GetSymmetrySubgroups`
:param angles: :class:`dict` (key = chain-pair-tuple, value = rotation axis)
:param angle_thr: Axis distance threshold for clustering (float).

Definition at line 2085 of file qsscoring.py.

◆ _GetDihedralSubgroups()

_GetDihedralSubgroups (   ent,
  chem_groups,
  angles,
  angle_thr 
)
protected
:return: Dihedral subgroups for :func:`_GetSymmetrySubgroups`
         (same return type as there). Empty list if fail.

:param ent: See :func:`_GetSymmetrySubgroups`
:param chem_groups: See :func:`_GetSymmetrySubgroups`
:param angles: :class:`dict` (key = chain-pair-tuple, value = Euler angles)
:param angle_thr: Euler angles distance threshold for clustering (float).

Definition at line 2054 of file qsscoring.py.

◆ _GetExtraWeights()

_GetExtraWeights (   contacts,
  done,
  mapped_residues 
)
protected
Return sum of extra weights for contacts of chains in set and not in done.
:return: Tuple (weight_extra_mapped, weight_extra_all).
         weight_extra_mapped only sums if both cX,rX in mapped_residues
         weight_extra_all sums all
:param contacts: See :func:`GetContacts` for first entity
:param done: List of (c1, c2, r1, r2) tuples to ignore
:param mapped_residues: See :func:`_GetMappedResidues`

Definition at line 2742 of file qsscoring.py.

◆ _GetMappedAlignments()

_GetMappedAlignments (   ent_1,
  ent_2,
  chain_mapping,
  res_num_alignment 
)
protected
:return: Alignments of 2 structures given chain mapping
         (see :attr:`QSscorer.alignments`).
:param ent_1: Entity containing all chains in *chain_mapping.keys()*.
              Views to this entity attached to first sequence of each aln.
:param ent_2: Entity containing all chains in *chain_mapping.values()*.
              Views to this entity attached to second sequence of each aln.
:param chain_mapping: See :attr:`QSscorer.chain_mapping`
:param res_num_alignment: See :attr:`QSscorer.res_num_alignment`

Definition at line 2678 of file qsscoring.py.

◆ _GetMappedResidues()

_GetMappedResidues (   alns)
protected
:return: Mapping of shared residues in *alns* (with views attached)
         (see :attr:`QSscorer.mapped_residues`).
:param alns: See :attr:`QSscorer.alignments`

Definition at line 2722 of file qsscoring.py.

◆ _GetMappedRMSD()

_GetMappedRMSD (   ent_1,
  ent_2,
  chain_mapping,
  transformation 
)
protected
:return: RMSD between complexes considering chain mapping.
:param ent_1: Entity mapped to *ent_2* (perfect alignment assumed between
              mapped chains as in :attr:`QSscorer.ent_to_cm_1`).
:param ent_2: Entity which was mapped to (perfect alignment assumed between
              mapped chains as in :attr:`QSscorer.ent_to_cm_2`).
:param chain_mapping: See :attr:`QSscorer.chain_mapping`
:param transformation: Superposition transformation to be applied to *ent_1*.

Definition at line 2521 of file qsscoring.py.

◆ _GetQsSuperposition()

_GetQsSuperposition (   alns)
protected
:return: Superposition result based on shared CA atoms in *alns*
         (with views attached) (see :attr:`QSscorer.superposition`).
:param alns: See :attr:`QSscorer.alignments`

Definition at line 2871 of file qsscoring.py.

◆ _GetScores()

_GetScores (   contacts_1,
  contacts_2,
  mapped_residues,
  chain_mapping 
)
protected
Get QS scores (see :class:`QSscorer`).

Note that if some chains are not to be considered at all, they must be removed
from *contacts_1* / *contacts_2* prior to calling this.

:param contacts_1: See :func:`GetContacts` for first entity
:param contacts_2: See :func:`GetContacts` for second entity
:param mapped_residues: See :func:`_GetMappedResidues`
:param chain_mapping: Maps any chain name in *mapped_residues* to chain name
                      for *contacts_2*.
:type chain_mapping:  :class:`dict` (:class:`str` / :class:`str`)
:return: Tuple (QS_best, QS_global) (see :attr:`QSscorer.best_score` and
         see :attr:`QSscorer.global_score`)

Definition at line 2766 of file qsscoring.py.

◆ _GetSuperpositionMapping()

_GetSuperpositionMapping (   ent_1,
  ent_2,
  chem_mapping,
  transformation,
  sup_thr,
  sup_fract 
)
protected
:return: Dict with chain mapping from *ent_1* to *ent_2* or None if failed
         (see :func:`_CheckClosedSymmetry`).
:param ent_1: See :func:`_CheckClosedSymmetry`
:param ent_2: See :func:`_CheckClosedSymmetry`
:param chem_mapping: See :func:`_CheckClosedSymmetry`
:param transformation: Superposition transformation to be applied to *ent_1*.
:param sup_thr: See :func:`_CheckClosedSymmetry`
:param sup_fract: See :func:`_CheckClosedSymmetry`

Definition at line 2453 of file qsscoring.py.

◆ _GetSymmetrySubgroups()

_GetSymmetrySubgroups (   qs_ent,
  ent,
  chem_groups 
)
protected
Identify the symmetry (either cyclic C or dihedral D) of the protein and find
all possible symmetry subgroups. This is done testing all combination of chain
superposition and clustering them by the angles (D) or the axis (C) of the Rt
operator.

Groups of superposition which can fully reconstruct the structure are possible
symmetry subgroups.

:param qs_ent: Entity with cached angles and axis.
:type qs_ent:  :class:`QSscoreEntity`
:param ent: Entity from which to extract chains (perfect alignment assumed
            for superposition as in :attr:`QSscorer.ent_to_cm_1`).
:type ent:  :class:`EntityHandle` or :class:`EntityView`
:param chem_groups: List of tuples/lists of chain names in *ent*. Each list
                    contains all chains belonging to a chem. group (could be
                    from :attr:`QSscoreEntity.chem_groups` or from "keys()"
                    or "values()" of :attr:`QSscorer.chem_mapping`)

:return: A list of possible symmetry subgroups (each in same format as
         :attr:`QSscorer.symm_1`). If no symmetry is found, we return a list
         with a single symmetry subgroup with a single group with all chains.

Definition at line 1985 of file qsscoring.py.

◆ _LimitChemMapping()

_LimitChemMapping (   chem_mapping,
  limit_1,
  limit_2 
)
protected
:return: Chem. mapping containing only chains in *limit_1* and *limit_2*
:rtype:  Same as :attr:`QSscorer.chem_mapping`
:param chem_mapping: See :attr:`QSscorer.chem_mapping`
:param limit_1: Limits chain names in chem_mapping.keys()
:type limit_1:  List/tuple of strings
:param limit_2: Limits chain names in chem_mapping.values()
:type limit_2:  List/tuple of strings

Definition at line 2239 of file qsscoring.py.

◆ _ListPossibleMappings()

_ListPossibleMappings (   sup1,
  sup2,
  chem_mapping 
)
protected
Return a flat list of all possible mappings given *chem_mapping* and keeping
mapping of *sup1* and *sup2* fixed. For instance if elements are chain names
this is all the mappings to check for a given superposition.

Elements in first complex are defined by *chem_mapping.keys()* (list of list
of elements) and elements in second complex by *chem_mapping.values()*. If
complexes don't have same number of elements, we map only elements for the one
with less. Also mapping is only between elements of mapped groups according to
*chem_mapping*.
         
:rtype:  :class:`list` of :class:`dict` (key = element in chem_mapping-key,
         value = element in chem_mapping-value)
:param sup1: Element for which mapping is fixed.
:type sup1:  Like element in chem_mapping-key
:param sup2: Element for which mapping is fixed.
:type sup2:  Like element in chem_mapping-value
:param chem_mapping: Defines mapping between groups of elements (e.g. result
                     of :func:`_LimitChemMapping`).
:type chem_mapping:  :class:`dict` with key / value = :class:`tuple`

:raises: :class:`QSscoreError` if reference complex (first one or one with
         less elements) has more elements for any given mapped group.

Definition at line 2318 of file qsscoring.py.

◆ _MergeAlignedChains()

_MergeAlignedChains (   alns,
  ent_1,
  ent_2,
  calpha_only,
  penalize_extra_chains 
)
protected
Create two new entities (based on the alignments attached views) where all
residues have same numbering (when they're aligned) and they are all pushed to
a single chain X. Also append extra chains contained in *ent_1* and *ent_2*
but not contained in *alns*.

Used for :attr:`QSscorer.lddt_ref` and :attr:`QSscorer.lddt_mdl`

:param alns: List of alignments with attached views (first sequence: *ent_1*,
             second: *ent_2*). Residue number in single chain is column index
             of current alignment + sum of lengths of all previous alignments
             (order of alignments as in input list).
:type alns:  See :attr:`QSscorer.alignments`
:param ent_1: First entity to process.
:type ent_1:  :class:`~ost.mol.EntityHandle`
:param ent_2: Second entity to process.
:type ent_2:  :class:`~ost.mol.EntityHandle`
:param calpha_only: If True, we only include CA atoms instead of all.
:type calpha_only:  :class:`bool`
:param penalize_extra_chains: If True, extra chains are added to model and
                              reference. Otherwise, only mapped ones.
:type penalize_extra_chains:  :class:`bool`

:return: Tuple of two single chain entities (from *ent_1* and from *ent_2*)
:rtype:  :class:`tuple` of :class:`~ost.mol.EntityHandle`

Definition at line 2914 of file qsscoring.py.

◆ _PermutationOrCombinations()

_PermutationOrCombinations (   sup1,
  sup2,
  chem_mapping 
)
protected
Should match len(_ListPossibleMappings(sup1, sup2, chem_mapping)).

Definition at line 2300 of file qsscoring.py.

◆ _SelectFew()

_SelectFew (   l,
  max_elements 
)
protected
Return l or copy of l with at most *max_elements* entries.

Definition at line 1713 of file qsscoring.py.

◆ _ValidChainGroup()

_ValidChainGroup (   group,
  ent 
)
protected
:return: True, if *group* has unique chain names and as many chains as *ent*
:rtype:  :class:`bool`
:param group: Symmetry groups to check
:type group:  Same as :attr:`QSscorer.symm_1`
:param ent: See :func:`_GetSymmetrySubgroups`

Definition at line 2225 of file qsscoring.py.

◆ _weight()

_weight (   dist)
protected
This weight expresses the probability of two residues to interact given the CB
distance (from Xu et al. http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2573399/)

Definition at line 2860 of file qsscoring.py.

◆ FilterContacts()

FilterContacts (   contacts,
  chain_names 
)
Filter contacts to contain only contacts for chains in *chain_names*.

:param contacts: Connectivity dictionary as produced by :func:`GetContacts`.
:type contacts:  :class:`dict`
:param chain_names: Chain names to keep.
:type chain_names:  :class:`list` or (better) :class:`set`
:return: New connectivity dictionary (format as in :func:`GetContacts`)
:rtype:  :class:`dict`

Definition at line 882 of file qsscoring.py.

◆ GetContacts()

GetContacts (   entity,
  calpha_only,
  dist_thr = 12.0 
)
Get inter-chain contacts of a macromolecular entity.

Contacts are pairs of residues within a given distance belonging to different
chains. They are stored once per pair and include the CA/CB-CA/CB distance.

:param entity: An entity to check connectivity for.
:type entity:  :class:`~ost.mol.EntityHandle` or :class:`~ost.mol.EntityView`
:param calpha_only: If True, we only consider CA-CA distances. Else, we use CB
                    unless the residue is a GLY.
:type calpha_only:  :class:`bool`
:param dist_thr: Maximal CA/CB-CA/CB distance to be considered in contact.
:type dist_thr:  :class:`float`
:return: A connectivity dictionary. A pair of residues with chain names
         *ch_name1* & *ch_name2* (*ch_name1* < *ch_name2*), residue numbers
         *res_num1* & *res_num2* and distance *dist* (<= *dist_thr*) are
         stored as *result[ch_name1][ch_name2][res_num1][res_num2]* = *dist*.
:rtype:  :class:`dict`

Definition at line 905 of file qsscoring.py.