Reference navigation
On this page
CLASS · v0.9.1
BackboneMorph
Move matched backbone residues in order and fade unmatched residues.
from proteinmotion import BackboneMorphConstructor
BackboneMorph(
source,
destination,
*,
match=None,
residue_delay=0.008,
fade_out=(0.0, 0.35),
fade_in=(0.65, 1.0),
align=True,
motion_easing='smooth',
**match_options,
)Parameters
| Parameter | Default | Description |
|---|---|---|
source | Required | Source Protein. |
destination | Required | Destination Protein. |
matchkeyword only | None | ContactMatch correspondence; None computes one using match_options. |
residue_delaykeyword only | 0.008 | Delay in seconds between successive residue starts. |
fade_outkeyword only | (0.0, 0.35) | Normalized progress interval for fading unmatched source residues. |
fade_inkeyword only | (0.65, 1.0) | Normalized progress interval for fading unmatched destination residues. |
alignkeyword only | True | Align the destination to the source before interpolation. |
motion_easingkeyword only | 'smooth' | Per-residue motion: "smooth" or "linear". |
**match_options | — | Options passed to match_backbones() when match is None. |
Notes
Each matched residue moves for run_time − (matched count − 1) × residue_delay seconds. Unmatched source and destination residues use fade_out and fade_in intervals. Both proteins’ geometry, transforms, and opacity belong to this animation. In ball-and-stick mode, atoms translate with their residue Cα and the atom sets crossfade. Side-chain atoms use their original residue geometry.
Example and output
Run this command from a repository checkout.
proteinmotion render examples/backbone_morph.py BackboneDemo \
-o morph.mp4 --fps 60A contact-map match selects 114 Cα pairs. Matched residues move in sequence from N to C; unmatched residues fade out or in.
Methods and properties
| Name | Description |
|---|---|
| targetsproperty | Objects whose state this animation changes. |
| bind()method | Capture starting values when the scene schedules the animation. |
| apply()method | Evaluate the animation at eased progress alpha. Called by the timeline. |
BackboneMorph.targetsObjects whose state this animation changes.
BackboneMorph.bind()Capture starting values when the scene schedules the animation.
Returns: None
Called by ProteinScene.play(). An animation instance can be bound once.
BackboneMorph.apply(alpha)Evaluate the animation at eased progress alpha. Called by the timeline.
| Parameter | Default | Description |
|---|---|---|
alpha | Required | Eased animation progress in [0, 1]. |
Returns: None