OpenStructure
Public Member Functions | Static Public Member Functions
QSScorer Class Reference

Inherited by _QSScoreGreedySearcher.

Public Member Functions

def __init__ (self, target, chem_groups, model, alns, contact_d=12.0)
 
def qsent1 (self)
 
def chem_groups (self)
 
def qsent2 (self)
 
def alns (self)
 
def Score (self, mapping, check=True)
 
def ScoreInterface (self, trg_ch1, trg_ch2, mdl_ch1, mdl_ch2)
 
def FromFlatMapping (self, flat_mapping)
 

Static Public Member Functions

def FromMappingResult (mapping_result)
 

Detailed Description

 Helper object to compute QS-score

Tightly integrated into the mechanisms from the chain_mapping module.
The prefered way to derive an object of type :class:`QSScorer` is through
the static constructor: :func:`~FromMappingResult`. Example score
computation including mapping:

::

    from ost.mol.alg.qsscore import QSScorer
    from ost.mol.alg.chain_mapping import ChainMapper

    ent_1 = io.LoadPDB("path_to_assembly_1.pdb")
    ent_2 = io.LoadPDB("path_to_assembly_2.pdb")

    chain_mapper = ChainMapper(ent_1)
    mapping_result = chain_mapper.GetlDDTMapping(ent_2)
    qs_scorer = QSScorer.FromMappingResult(mapping_result)
    score_result = qs_scorer.Score(mapping_result.mapping)
    print("score:", score_result.QS_global)

QS-score computation in :func:`QSScorer.Score` implements caching.
Repeated computations with alternative chain mappings thus become faster.

:param target: Structure designated as "target". Can be fetched from
               :class:`ost.mol.alg.chain_mapping.MappingResult`
:type target: :class:`ost.mol.EntityView`/:class:`ost.mol.EntityHandle`
:param chem_groups: Groups of chemically equivalent chains in *target*.
                    Can be fetched from
                    :class:`ost.mol.alg.chain_mapping.MappingResult`
:type chem_groups: :class:`list` of :class:`list` of :class:`str`
:param model: Structure designated as "model". Can be fetched from
              :class:`ost.mol.alg.chain_mapping.MappingResult`
:type model: :class:`ost.mol.EntityView`/:class:`ost.mol.EntityHandle`
:param alns: Each alignment is accessible with ``alns[(t_chain,m_chain)]``.
             First sequence is the sequence of the respective chain in
             :attr:`~qsent1`, second sequence the one from :attr:`~qsent2`.
             Can be fetched from
             :class:`ost.mol.alg.chain_mapping.MappingResult`
:type alns: :class:`dict` with key: :class:`tuple` of :class:`str`, value:
            :class:`ost.seq.AlignmentHandle`

Definition at line 281 of file qsscore.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  target,
  chem_groups,
  model,
  alns,
  contact_d = 12.0 
)

Definition at line 324 of file qsscore.py.

Member Function Documentation

◆ alns()

def alns (   self)
 Alignments between chains in :attr:`~qsent1` and :attr:`~qsent2`

Provided at object construction. Each alignment is accessible with
``alns[(t_chain,m_chain)]``. First sequence is the sequence of the
respective chain in :attr:`~qsent1`, second sequence the one from
:attr:`~qsent2`.

:type: :class:`dict` with key: :class:`tuple` of :class:`str`, value:
       :class:`ost.seq.AlignmentHandle`

Definition at line 400 of file qsscore.py.

◆ chem_groups()

def chem_groups (   self)
 Groups of chemically equivalent chains in *target*

Provided at object construction

:type: :class:`list` of :class:`list` of :class:`str`

Definition at line 382 of file qsscore.py.

◆ FromFlatMapping()

def FromFlatMapping (   self,
  flat_mapping 
)
 Same as :func:`Score` but with flat mapping

:param flat_mapping: Dictionary with target chain names as keys and
                     the mapped model chain names as value
:type flat_mapping: :class:`dict` with :class:`str` as key and value
:returns: Result object of type :class:`QSScorerResult`

Definition at line 485 of file qsscore.py.

◆ FromMappingResult()

def FromMappingResult (   mapping_result)
static
 The preferred way to get a :class:`QSScorer`

Static constructor that derives an object of type :class:`QSScorer`
using a :class:`ost.mol.alg.chain_mapping.MappingResult`

:param mapping_result: Data source
:type mapping_result: :class:`ost.mol.alg.chain_mapping.MappingResult`

Definition at line 360 of file qsscore.py.

◆ qsent1()

def qsent1 (   self)
 Represents *target*

:type: :class:`QSEntity`

Definition at line 374 of file qsscore.py.

◆ qsent2()

def qsent2 (   self)
 Represents *model*

:type: :class:`QSEntity`

Definition at line 392 of file qsscore.py.

◆ Score()

def Score (   self,
  mapping,
  check = True 
)
 Computes QS-score given chain mapping

Again, the preferred way is to get *mapping* is from an object
of type :class:`ost.mol.alg.chain_mapping.MappingResult`.

:param mapping: see 
                :attr:`ost.mol.alg.chain_mapping.MappingResult.mapping`
:type mapping: :class:`list` of :class:`list` of :class:`str`
:param check: Perform input checks, can be disabled for speed purposes
              if you know what you're doing.
:type check: :class:`bool`
:returns: Result object of type :class:`QSScorerResult`

Definition at line 413 of file qsscore.py.

◆ ScoreInterface()

def ScoreInterface (   self,
  trg_ch1,
  trg_ch2,
  mdl_ch1,
  mdl_ch2 
)
 Computes QS-score only considering one interface

This only works for interfaces that are computed in :func:`Score`, i.e.
interfaces for which the alignments are set up correctly.

:param trg_ch1: Name of first interface chain in target
:type trg_ch1: :class:`str`
:param trg_ch2: Name of second interface chain in target
:type trg_ch2: :class:`str`
:param mdl_ch1: Name of first interface chain in model
:type mdl_ch1: :class:`str`
:param mdl_ch2: Name of second interface chain in model
:type mdl_ch2: :class:`str`
:returns: Result object of type :class:`QSScorerResult`
:raises: :class:`RuntimeError` if no aln for trg_ch1/mdl_ch1 or
         trg_ch2/mdl_ch2 is available.

Definition at line 450 of file qsscore.py.


The documentation for this class was generated from the following file: