Getting the radius of gyration#

Computing geometric or mass-weighted radii of gyration in nanometers.

import molsysmt as msm
trajectory = msm.systems['pentalanine']['traj_pentalanine.h5msm']

Use equal weights for the geometric radius or weights='masses' for the mass-weighted value. Long H5MSM trajectories can be processed with bounded memory by selecting heavy_mode='force'; auto chooses between eager and chunked execution.

rg = msm.structure.get_radius_of_gyration(
    trajectory, selection='atom_type!="H"', weights='masses', heavy_mode='force'
)
rg.shape