stacker.visualization.display_ssfs

Contents

stacker.visualization.display_ssfs#

display_ssfs(numpy_arrays, res_indices, seconds_per_frame=10, tick_distance=10, outfile_prefix='', scale_limits=(0, 7), outfile='', scale_style='bellcurve', xy_line=True, **kwargs)[source]#

Alias for display_arrays_as_video().

display_arrays_as_video(

ssfs, res_indices, seconds_per_frame = 10, tick_distance = 10, outfile_prefix = ‘’, scale_limits = (0,7), outfile = ‘’, scale_style = ‘bellcurve’, xy_line = True, **kwargs

)

Displays SSF data to output or writes SSF as a PNG

Visualizes the data for an SSF for a trajectory or a single frame. Takes an SSF array outputted from get_residue_distance_for_frame, get_residue_distance_for_trajectory, or system_stacking_fingerprints and treats them as frames in a video, filling in a grid at position i, j by the value at i, j in the array.

Parameters:
ssfsarray_like

List or array of 2D NumPy arrays representing SSFs, output of system_stacking_fingerprints

res_indiceslist or str

The list of residue indices used in the pairwise analysis. Parameter residue_desired passed to filter_traj() Accepts smart-indexed str representing a list of residues (e.g ‘1-5,6,39-48’)

seconds_per_frameint, default = 10

Number of seconds to display each matrix for.

tick_distanceint, default = 10

Distance between ticks in blocks of consecutive residues.

outfilestr

Image output filepath to write a single SSF to. Format inferred from file extension. png, pdf, ps, eps, and svg supported.

outfile_prefixstr

Prefix for image filepath to write multiple frames to. Format inferred from file extension. png, pdf, ps, eps, and svg supported.

scale_limitstuple, default = (0, 7)

Limits of the color scale.

scale_style{‘bellcurve’, ‘gradient’}, default = ‘bellcurve’

Style of color scale.

xy_linebool, default = True

Draw x = y line to separate matrix halves.

**kwargsdict, optional

Additional keyword arguments to customize the plot:

  • fontsizeint, default = 10

    Font size for all text elements.

  • fig_widthfloat, default = 8

    Width of the figure in inches.

  • fig_heightfloat, default = 8

    Height of the figure in inches.

  • title_fontsizeint, default = fontsize

    Font size for the title.

  • legend_fontsizeint, default = fontsize

    Font size for the legend.

  • cb_fontsizeint, default = fontsize

    Font size for the colorbar tick labels.

  • xaxis_fontsizeint, default = fontsize

    Font size for the x-axis tick labels.

  • yaxis_fontsizeint, default = fontsize

    Font size for the y-axis tick labels.

Returns:
None

Displays video of NumPy arrays.

See also

create_axis_labels

Designates the axis labels to use in the SSF plot.

get_residue_distance_for_frame

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

get_residue_distance_for_trajectory

get SSF data for all frames of a trajectory

system_stacking_fingerprints

Alias for this get_residue_distance_for_trajectory

display_ssfs

Alias for this function.

Examples

>>> import stacker as st
>>> import mdtraj as md
>>> trajectory_file = 'stacker/testing/first10_5JUP_N2_tUAG_aCUA_+1GCU_nowat.mdcrd'
>>> topology_file = 'stacker/testing/5JUP_N2_tUAG_aCUA_+1GCU_nowat.prmtop'
>>> trj = md.load(trajectory_file, top = topology_file)
>>> residue_selection_query = 'resi 90 to 215'
>>> frames_to_include = [1,2,3,4,5]
>>> trj_sub = trj.atom_slice(trj.top.select(residue_selection_query))
>>> resSeqs = [res.resSeq for res in trj_sub.topology.residues]
>>> frames = st.get_residue_distance_for_trajectory(trj_sub, frames_to_include, threads = 5)
Frame 2 done.
Frame 3 done.
Frame 1 done.
Frame 5 done.
Frame 4 done.
>>> st.display_arrays_as_video([st.get_frame_average(frames)], resSeqs, seconds_per_frame=10)
# Displays SSF for each frame of this trajectory to standard output