ProteinMotion
Reference navigation
On this page

StructureMatch

Atom correspondence between two structures, with the residue and chain pairs behind it and the rigid core they share.

python
from proteinmotion import StructureMatch

Constructor

python
StructureMatch(
    source_atoms: np.ndarray,
    target_atoms: np.ndarray,
    residue_pairs: list=field(default_factory=list),
    chain_pairs: list=field(default_factory=list),
    core: np.ndarray=field(default_factory=lambda: np.empty(0, dtype=int)),
    core_rmsd: float=float('nan'),
)

Parameters

ParameterDefaultDescription
source_atomsnp.ndarrayRequiredMatched source atom indices.
target_atomsnp.ndarrayRequiredTarget atom indices, one per source atom.
residue_pairslistfield(default_factory=list)Matched (source, target) topology residue indices, including ligands.
chain_pairslistfield(default_factory=list)(source chain, target chain, sequence identity) for each paired chain.
corenp.ndarrayfield(default_factory=lambda: np.empty(0, dtype=int))Source Cα/C4′ atom indices of the rigid core: matched trace atoms that superpose within 2 Å after pruning the worst pairs and refitting. StructureMorph and domain_motion superpose on it by default.
core_rmsdfloatfloat('nan')Root-mean-square deviation of the rigid core after superposition, in Å.

Attributes

NameDescription
source_atomsMatched source atom indices.
target_atomsTarget atom indices, one per source atom.
residue_pairsMatched (source, target) topology residue indices, including ligands.
chain_pairs(source chain, target chain, sequence identity) for each paired chain.
coreSource Cα/C4′ atom indices of the rigid core: matched trace atoms that superpose within 2 Å after pruning the worst pairs and refitting. StructureMorph and domain_motion superpose on it by default.
core_rmsdRoot-mean-square deviation of the rigid core after superposition, in Å.

Example and output

Run this command from a repository checkout.

Code Render command
bash
proteinmotion render examples/structure_morph.py HemoglobinMorph \
  -o hemoglobin-morph.mp4 --fps 60
Output Preview · 17.7 s · 60 fps
Hemoglobin from T to R

Deoxyhemoglobin (2DN2) morphs to oxyhemoglobin (2DN1, expanded to its tetramer), superposed on α1β1. α2β2 turns 14° in the image plane while O₂ appears at each heme. A heatmap shows Cα–Cα distances changing between the αβ dimers but not within them. The path illustrates the difference between the two structures.

Methods and properties

NameDescription
reportpropertyChain pairs with sequence identity, counts of matched residues and atoms, and the rigid core.
python
StructureMatch.report

Chain pairs with sequence identity, counts of matched residues and atoms, and the rigid core.