tm_score#

biotite.structure.tm_score(reference, subject, reference_indices, subject_indices, reference_length='shorter')[source]#

Compute the TM-score for the given protein structures. [1]

Parameters:
reference, subjectAtomArray or ndarray, dtype=float

The protein structures to be compared. The number of their atoms may differ from each other. Alternatively, coordinates can be provided directly as ndarray.

reference_indices, subject_indicesndarray, dtype=int, shape=(n,)

The indices of the atoms in the reference and subject, respectively, that correspond to each other. In consequence, the length of both arrays must be equal.

reference_lengthint or {“shorter”, “longer”, “reference”}

The reference length used to normalize the TM-score. If “shorter”, the number of residues in the smaller structure is used. If “longer”, the number of residues in the larger structure is used. If “reference”, the number of residues in the reference structure is used. The length can also be provided directly as an integer.

Returns:
tm_scorefloat

The TM-score for the given structure.

See also

superimpose_structural_homologs

Aims to minimize the TM-score between two structures. It also returns the corresponding atom indices that can be passed to tm_score().

Notes

This functions takes the coordinates as they are. It is recommended to use superimpose them using superimpose_structural_homologs() before, as that function aims to find a superimposition that minimizes the TM-score.

References

Examples

>>> reference = atom_array_stack[0]
>>> subject = atom_array_stack[1]
>>> superimposed, _, ref_indices, sub_indices = superimpose_structural_homologs(
...     reference, subject, max_iterations=1
... )
>>> print(tm_score(reference, superimposed, ref_indices, sub_indices))
0.69...