stacker.pairwise_distance.get_top_stacking

stacker.pairwise_distance.get_top_stacking#

get_top_stacking(trj, matrix, csv='', n_events=5, include_adjacent=False)[source]#

Returns top stacking residue pairs for a given System Stacking Fingerprint (SSF)

Given a trajectory and a SSF made from get_residue_distance_for_frame() or get_frame_average() prints the residue pairings with the strongest stacking events (ie. the residue pairings with center of geometry distance closest to 3.5Å).

Parameters:
trjmd.Trajectory

trajectory used to get the stacking fingerprint

matrixtyping.ArrayLike

Single-frame SSF created by get_residue_distance_for_frame() or get_frame_average()

csvstr, default = ‘’,

output filename of the tab-separated txt file to write data to. If empty, data printed to standard output

n_eventsint, default = 5

maximum number of stacking events to display, if -1 display all residue pairings

include_adjacentbool, default = False

True if adjacent residues should be included in the printed output

See also

get_residue_distance_for_frame

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

get_residue_distance_for_trajectory

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

system_stacking_fingerprints

Alias for get_residue_distance_for_trajectory

Examples

We can calculate the stacking events for a single frame:

>>> 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', 
...                             atoms = {'C2','C4','C6'})
>>> ssf = st.get_residue_distance_for_frame(filtered_traj, frame = 2, write_output = False)
>>> ssf.shape
(252,252)
>>> st.get_top_stacking(filtered_traj, ssf)
Row     Column  Value
197     195     3.50
420     413     3.51
94      127     3.51
93      130     3.53
117     108     3.38

Or we can get most residue pairs that had the most stacking across many frames of a trajectory:

>>> 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', 
...                             atoms = {'C2','C4','C6'})
>>> ssfs = st.get_residue_distance_for_trajectory(filtered_traj, frames = '1-3', write_output = False)
>>> avg_ssf = st.get_frame_average(ssfs)
>>> avg_ssf.shape
(252, 252)
>>> st.get_top_stacking(filtered_traj, ssf)
Row     Column  Value
130     93      3.56
108     117     3.44
195     197     3.61
127     94      3.65
47      167     3.66