plinder.core.structure.superimpose#
- plinder.core.structure.superimpose.superimpose_chain(fixed: AtomArray | AtomArrayStack, mobile: AtomArray | AtomArrayStack, substitution_matrix: str | SubstitutionMatrix = 'BLOSUM62', gap_penalty: tuple[int, int] = (-10, -1), min_anchors: int = 3, outlier_threshold: float = 1.5, max_iterations: int = 10) tuple[AtomArray | AtomArrayStack, AffineTransformation, NDArray[int64], NDArray[int64]][source]#
Superimpose one protein chain onto another one, considering sequence differences and conformational outliers.
The method finds corresponding residues by sequence alignment and selects their \(C_{\alpha}\) atoms as superimposition anchors. Then iteratively the anchor atoms are superimposed and outliers (in terms of high squared distance between matching anchor atoms) are removed, until either no outliers are left or the maximum number of iterations is reached.
- Parameters:
- fixedAtomArray, shape(n,) or AtomArrayStack, shape(m,n) or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
The fixed structure(s). Alternatively coordinates can be given.
- mobileAtomArray, shape(n,) or AtomArrayStack, shape(m,n) or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
The structure(s) which is/are superimposed on the fixed structure. Alternatively coordinates can be given.
- substitution_matrixstr or SubstitutionMatrix,
The (name of the) substitution matrix used for sequence alignment.
- gap_penaltyint or tuple of int, optional
The gap penalty for sequence alignment. A single value indicates a linear penalty, while a tuple indicates an affine penalty.
- min_anchors: int, optional
If less than min_anchors anchors are found by sequence alignment, the method ditches the alignment and matches all \(C_{\alpha}\) atoms. If the number of \(C_{\alpha}\) atoms does not match in this fallback case, an exception is raised. Furthermore, the outlier removal is stopped, if less than min_anchors anchors would be left.
- outlier_thresholdfloat, optional
The threshold for considering a conformational outlier. The threshold is given in units of IQR. This means that a residue is considered an outlier, if its squared distance is outlier_threshold x IQR above the upper quartile.
- max_iterationsint, optional
The maximum number of iterations for removing conformational outliers.
- Returns:
- fittedAtomArray or AtomArrayStack or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
A copy of the mobile structure(s), superimposed on the fixed structure. Only coordinates are returned, if coordinates were given in mobile.
- transformAffineTransformation
This object contains the affine transformation(s) that were applied on mobile.
AffineTransformation.apply()can be used to transform another AtomArray in the same way.- fixed_anchor_indices, mobile_anchor_indicesndarray, shape(k,), dtype=int
The indices of the anchor \(C_{\alpha}\) atoms in the fixed and mobile structure, respectively. These atoms were used for the superimposition.
- Note:
As this method relies on amino acid sequence alignment, it works only for proteins with decent homology.