neurosnap.algos.LDDT module#

Code for LDDT (Local Distance Difference Test) calculation, adapted from ba-lab/disteval

neurosnap.algos.LDDT.calc_lddt(reference, prediction, *, model_ref=None, model_pred=None, chains_ref=None, chains_pred=None, R=15.0, sep_thresh=-1, T_set=(0.5, 1.0, 2.0, 4.0), precision=4, require_standard_aa=True)[source]#

Compute lDDT from distance maps or Protein structures.

Parameters:
  • reference (Union[ndarray, Protein]) – Distance map or Protein used as the ground truth.

  • prediction (Union[ndarray, Protein]) – Distance map or Protein to compare against the reference.

  • model_ref (Optional[int]) – Model index to select when reference is a Protein.

  • model_pred (Optional[int]) – Model index to select when prediction is a Protein.

  • chains_ref (Optional[List[str]]) – Chain identifiers to include when reference is a Protein.

  • chains_pred (Optional[List[str]]) – Chain identifiers to include when prediction is a Protein.

  • R (float) – Maximum reference distance to consider when defining the L set.

  • sep_thresh (int) – Minimum sequence separation between residue pairs.

  • T_set (Sequence[float]) – Error thresholds used to compute preserved distance fractions.

  • precision (int) – Decimal precision of the reported score; use 0 or negative to skip rounding.

  • require_standard_aa (bool) – Skip residues with unknown amino-acid or nucleotide codes when True.

Return type:

float

Returns:

lDDT score between the reference and prediction.

Raises:
  • ValueError – If distance maps do not share the same shape.

  • TypeError – If the inputs are not both arrays or both Protein instances.