stacker.pairwise_distance.get_residue_distance_for_frame

stacker.pairwise_distance.get_residue_distance_for_frame#

get_residue_distance_for_frame(trj, frame, res1_atoms=('C2', 'C4', 'C6'), res2_atoms=('C2', 'C4', 'C6'), write_output=True)[source]#

Calculates System Stacking Fingerprint (SSF) between all residues in a given frame.

Calculates the distances between all pairs of residues in a given frame of a trajectory. Outputs as a square matrix with all residues on each side. This is the data behind a System Stacking Fingerprint (SSF)

Parameters:
trjmd.Trajectory

Trajectory to analyze (must have a topology).

frameint

1-indexed frame to analyze.

res1_atomstuple, default=(“C2”, “C4”, “C6”)

Atom names whose positions are averaged to find the center of residue 1.

res2_atomstuple, default=(“C2”, “C4”, “C6”)

Atom names whose positions are averaged to find the center of residue 2.

write_outputbool, default=True

If True, displays a loading screen to standard output.

Returns:
pairwise_distancesnp.typing.ArrayLike

Matrix where position (i, j) represents the distance from residue i to residue j.

See also

get_residue_distance_for_trajectory

Calculates System Stacking Fingerprints (SSFs) for all residues across all frames of a trajectory

filter_traj

Filters an input trajectory to only the specified atoms and residues

mdtraj.load

Load a trajectory+topology file

Examples

>>> import stacker as st
>>> filtered_traj = st.filter_traj('stacker/testing/first10_5JUP_N2_tUAG_aCUA_+1GCU_nowat.mdcrd', 
...                             'stacker/testing/5JUP_N2_tUAG_aCUA_+1GCU_nowat.prmtop', 
...                             residues = '2-5,13-16,23-31,46-51,65-76,88-104,122-141,164-175,184-198,288-289,401-415,420-430', 
...                             atoms = {'C2','C4','C6'})
>>> ssf = st.get_residue_distance_for_frame(filtered_traj, frame = 2, write_output = False)
>>> ssf.shape
(127, 127)