conkit.core.distance module

Residue distance prediction container used throughout ConKit

class Distance(res1_seq, res2_seq, distance_scores, distance_bins, raw_score=None, distance_bound=(0, 8))[source]

Bases: conkit.core.contact.Contact

A residue pair distance template to store all associated information. This class inherits methods and attributes from Contact

Examples

>>> import numpy as np
>>> from conkit.core import Distance
>>> distance = Distance(1, 25, (0.25, 0.45, 0.25, 0.05), ((0, 4), (4, 6), (6, 8), (8, np.inf)))
>>> print(distance)
Distance(id="(1, 25)" res1="A" res1_seq=1 res2="A" res2_seq=25 raw_score=0.95,
distance_scores=(0.25, 0.45, 0.25, 0.05), distance_bins=((0, 4), (4, 6), (6, 8), (8, inf)))
distance_bins

The distance boundaries of the bins associated to this residue pair in Ångstrom. Intervals are open on the left, i.e. a < d ≤ b

Type:tuple
distance_scores

The prediction scores associated to each distance bin for this residue pair

Type:tuple
raw_score

The prediction score for the residue pair to be within 8Å of each other

Type:float
as_contact(distance_cutoff)[source]

Create a Contact instance with the information in this Distance instance.

Parameters:distance_cutoff (int, float) – The distance cutoff used to consider a residue pair within contact of each other
Returns:A contact with the information present in this distance instance.
Return type:Contact
distance_bins
distance_scores
get_probability_within_distance(distance)[source]

Calculate the probability that the residue pair is within a given distance

Parameters:distance (int, float) –
Returns:The probability that the residue pair is within the specified distance
Return type:None, float
Raises:ValueError – distance is not a positive number
max_score

Maximum confidence score observed across the different distance bins

predicted_distance

Median distance associated with the distance bin with the highest confidence score

predicted_distance_bin

Distance bin with the highest confidence score

raw_score
res1_chain
res2_chain
reshape_bins(new_bins)[source]

Reshape the predicted distance bins and update distance_scores and distance_bins accordingly

Parameters:new_bins (tuple) – A tuple of tuples, where each element corresponds with the upper and lower edges of the intervals for the new distance bins
Raises:ValueError – The new distance bins are not valid
scalar_score
weight