contact_score – Contact-Based Scores

class ContactEntity(ent, contact_d=5.0, contact_mode='aa')

Helper object for Contact-score computation

property view

The structure depending on contact_mode

Full view in case of “aa”, view that only contains representative atoms in case of “repr”.

Type:

ost.mol.EntityView

property contact_mode

The contact mode

Can either be “aa”, meaning that all atoms are considered to identify contacts, or “repr” which only considers distances between representative atoms. For peptides thats CB (CA for GLY), for nucleotides thats C3’.

Type:

str

property contact_d

Pairwise distance of residues to be considered as contacts

Given at ContactScorer construction

Type:

float

property chain_names

Chain names in view

Names are sorted

Type:

list of str

property interacting_chains

Pairs of chains in view with at least one contact

Type:

list of tuples

property contacts

Interchain contacts

Organized as dict with key (cname1, cname2) and values being a set of tuples with the respective residue indices. cname1 < cname2 evaluates to True.

property hr_contacts

Human readable interchain contacts

Human readable version of contacts. Simple list with tuples containing two strings specifying the residues in contact. Format: <cname>.<rnum>.<ins_code>

property interface_residues

Interface residues

Residues in each chain that are in contact with any other chain. Organized as dict with key cname and values the respective residue indices in a set.

property hr_interface_residues

Human readable interface residues

Human readable version of interface_residues. list of strings specifying the interface residues in format: <cname>.<rnum>.<ins_code>

GetChain(chain_name)

Get chain by name

Parameters:

chain_name (str) – Chain in view

GetSequence(chain_name)

Get sequence of chain

Returns sequence of specified chain as raw str

Parameters:

chain_name (str) – Chain in view

class ContactScorerResultICS(n_trg_contacts, n_mdl_contacts, n_union, n_intersection)

Holds data relevant to compute ics

property n_trg_contacts

Number of contacts in target

Type:

int

property n_mdl_contacts

Number of contacts in model

Type:

int

property precision

Precision of model contacts

The fraction of model contacts that are also present in target

Type:

int

property recall

Recall of model contacts

The fraction of target contacts that are also present in model

Type:

int

property ics

The Interface Contact Similarity score (ICS)

Combination of precision and recall using the F1-measure

Type:

float

class ContactScorerResultIPS(n_trg_int_res, n_mdl_int_res, n_union, n_intersection)

Holds data relevant to compute ips

property n_trg_int_res

Number of interface residues in target

Type:

int

property n_mdl_int_res

Number of interface residues in model

Type:

int

property precision

Precision of model interface residues

The fraction of model interface residues that are also interface residues in target

Type:

int

property recall

Recall of model interface residues

The fraction of target interface residues that are also interface residues in model

Type:

int

property ips

The Interface Patch Similarity score (IPS)

Jaccard coefficient of interface residues in model/target. Technically thats intersection/union

Type:

float

class ContactScorer(target, chem_groups, model, alns, contact_mode='aa', contact_d=5.0)

Helper object to compute Contact scores

Tightly integrated into the mechanisms from the chain_mapping module. The prefered way to derive an object of type ContactScorer is through the static constructor: FromMappingResult().

Usage is the same as for ost.mol.alg.QSScorer

static FromMappingResult(mapping_result, contact_mode='aa', contact_d=5.0)

The preferred way to get a ContactScorer

Static constructor that derives an object of type ContactScorer using a ost.mol.alg.chain_mapping.MappingResult

Parameters:

mapping_result (ost.mol.alg.chain_mapping.MappingResult) – Data source

property cent1

Represents target

Type:

ContactEntity

property chem_groups

Groups of chemically equivalent chains in target

Provided at object construction

Type:

list of list of str

property cent2

Represents model

Type:

ContactEntity

property alns

Alignments between chains in cent1 and cent2

Provided at object construction. Each alignment is accessible with alns[(t_chain,m_chain)]. First sequence is the sequence of the respective chain in cent1, second sequence the one from cent2.

Type:

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

ScoreICS(mapping, check=True)

Computes ICS given chain mapping

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

Parameters:
Returns:

Result object of type ContactScorerResultICS

ScoreICSInterface(trg_ch1, trg_ch2, mdl_ch1, mdl_ch2)

Computes ICS scores only considering one interface

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

Parameters:
  • trg_ch1 (str) – Name of first interface chain in target

  • trg_ch2 (str) – Name of second interface chain in target

  • mdl_ch1 (str) – Name of first interface chain in model

  • mdl_ch2 (str) – Name of second interface chain in model

Returns:

Result object of type ContactScorerResultICS

Raises:

RuntimeError if no aln for trg_ch1/mdl_ch1 or trg_ch2/mdl_ch2 is available.

ICSFromFlatMapping(flat_mapping)

Same as ScoreICS() but with flat mapping

Parameters:

flat_mapping (dict with str as key and value) – Dictionary with target chain names as keys and the mapped model chain names as value

Returns:

Result object of type ContactScorerResultICS

ScoreIPS(mapping, check=True)

Computes IPS given chain mapping

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

Parameters:
Returns:

Result object of type ContactScorerResultIPS

ScoreIPSInterface(trg_ch1, trg_ch2, mdl_ch1, mdl_ch2)

Computes IPS scores only considering one interface

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

Parameters:
  • trg_ch1 (str) – Name of first interface chain in target

  • trg_ch2 (str) – Name of second interface chain in target

  • mdl_ch1 (str) – Name of first interface chain in model

  • mdl_ch2 (str) – Name of second interface chain in model

Returns:

Result object of type ContactScorerResultIPS

Raises:

RuntimeError if no aln for trg_ch1/mdl_ch1 or trg_ch2/mdl_ch2 is available.

IPSFromFlatMapping(flat_mapping)

Same as ScoreIPS() but with flat mapping

Parameters:

flat_mapping (dict with str as key and value) – Dictionary with target chain names as keys and the mapped model chain names as value

Returns:

Result object of type ContactScorerResultIPS

Search

Enter search terms or a module, class or function name.

Contents

Documentation is available for the following OpenStructure versions:

(Currently viewing dev) / 2.8 / 2.7 / 2.6 / 2.5 / 2.4 / 2.3.1 / 2.3 / 2.2 / 2.1 / 2.0 / 1.9 / 1.8 / 1.7.1 / 1.7 / 1.6 / 1.5 / 1.4 / 1.3 / 1.2 / 1.11 / 1.10 / 1.1

This documentation is still under heavy development!
If something is missing or if you need the C++ API description in doxygen style, check our old documentation for further information.