pytraj.analysis.rmsd.
rotation_matrix
(traj=None, mask='', ref=0, mass=False, frame_indices=None, top=None, with_rmsd=False)¶Compute rotation matrix with/without rmsd
Parameters: | traj : Trajectory-like ref : {int, Frame}, default 0 (first Frame)
mask : str, default all atoms mass : bool, default False
frame_indices : {None, array-like}
top : Topology, optional with_rmsd : bool, default False
|
---|---|
Returns: | out : if with_rmsd=False, return numpy array, shape (n_frames, 3, 3)
|
Examples
>>> import pytraj as pt
>>> traj = pt.datafiles.load_tz2()
>>> mat = pt.calc_rotation_matrix(traj, mask='@CA')
>>> mat.shape
(101, 3, 3)
pytraj.analysis.rmsd.
pairwise_rmsd
(traj=None, mask='', metric='rms', top=None, dtype='ndarray', mat_type='full', frame_indices=None)¶Calculate pairwise rmsd with different metrics.
Parameters: | traj : Trajectory-like or iterable object mask : mask
metric : {‘rms’, ‘dme’, ‘srmsd’, ‘nofit’}
top : Topology, optional, default=None dtype: ndarray
mat_type : str, {‘full’, ‘half’}
|
---|
Notes
Install libcpptraj
with openmp
to get benefit from parallel
Examples
>>> import pytraj as pt
>>> traj = pt.datafiles.load_tz2_ortho()
>>> arr = pt.pairwise_rmsd(traj(0, 1000, mask='@CA'))
>>> # calculate pairwise rmsd for all frames using CA atoms, use `dme` (distance RMSD)
>>> # convert to numpy array
>>> arr_np = pt.pairwise_rmsd(traj, "@CA", metric="dme", dtype='ndarray')
>>> # calculate pairwise rmsd for all frames using CA atoms, nofit for RMSD
>>> # convert to numpy array
>>> arr_np = pt.pairwise_rmsd(traj, "@CA", metric="nofit", dtype='ndarray')
>>> # calculate pairwise rmsd for all frames using CA atoms
>>> # use symmetry-corrected RMSD, convert to numpy array
>>> arr_np = pt.pairwise_rmsd(traj, "@CA", metric="srmsd", dtype='ndarray')
>>> # use different dtype
>>> arr_np = pt.pairwise_rmsd(traj, "@CA", metric="srmsd", dtype='dataset')
pytraj.analysis.rmsd.
rmsd_perres
(traj=None, mask='', ref=0, mass=False, resrange=None, perres_mask=None, perres_center=False, perres_invert=False, frame_indices=None, top=None, dtype='dataset', **kwd)¶superpose traj
to ref
with mask, then calculate nofit rms for residues
in resrange with given perresmask
Returns: | out : pytraj.DatasetList, shape=(1+n_residues, n_frames)
|
---|
pytraj.analysis.rmsd.
rmsd_nofit
(traj=None, mask='', ref=0, mass=False, frame_indices=None, top=None, dtype='ndarray', **kwd)¶compute rmsd without fitting (translating and rotating)
Parameters: | traj : Trajectory-like mask : str ref : Frame or int mass : bool, default False
frame_indices : 1D array-like, default None
|
---|
Notes
This method is equal to pytraj.rmsd(traj, mask, ref, nofit=True, ...)
pytraj.analysis.rmsd.
rmsd
(traj=None, mask='', ref=0, ref_mask='', nofit=False, mass=False, update_coordinate=True, frame_indices=None, top=None, dtype='ndarray')¶compute rmsd
Parameters: | traj : Trajectory-like mask : str or 1D array-like of string or 1D or 2D array-like
ref : {Frame, int}, default=0 (first frame)
ref_mask: str, optional
nofit : bool, default False
mass : bool, default False
update_coordinate : bool, default True
frame_indices : int 1D array-like, default None
top : {Topology, str}, default None, optional dtype : return data type, default=’ndarray’ |
---|
Notes
Examples
>>> import pytraj as pt
>>> traj = pt.datafiles.load_trpcage()
>>> # all atoms, do fitting, using ref=traj[-3]
>>> data = pt.rmsd(traj, ref=-3)
>>> # rmsd for 3 maskes, do fitting, using ref=traj[0] (defaul)
>>> data = pt.rmsd(traj, mask=['@CA', '@C', ':3-18@CA'], dtype='dataset')
>>> # rmsd to first frame, use mass ':3-13' but do not perorm fitting
>>> data= pt.rmsd(traj, ref=traj[0], mask=':3-13', nofit=True)
>>> # use atom indices for mask
>>> data= pt.rmsd(traj, ref=traj[0], mask=range(40), nofit=True)
>>> # compute rmsd (and align) with reference having different atoms
>>> trpcage_traj = pt.datafiles.load_trpcage()[:]
>>> tz2_traj = pt.datafiles.load_tz2()[:1]
>>> data = pt.rmsd(trpcage_traj, mask='@1-10', ref=tz2_traj, ref_mask='@11-20')
>>> data
array([ 2.16203842, 2.28859396, 2.15817654, ..., 2.20767189,
2.30087764, 1.92654945])
Notes
-----
if ``traj`` is mutable and update_coordinate=True, its coordinates will be updated.
pytraj.analysis.rmsd.
symmrmsd
(traj, mask='', ref=0, ref_mask=None, fit=True, remap=False, mass=False, top=None, dtype='ndarray', frame_indices=None)¶Compute symmetry-corrected RMSD
Parameters: | traj : Trajectory-like mask : str, default ‘’ (all atoms) ref : {int, Frame}, default 0 (first frame) ref_mask : {str, None}, default None
fit : Bool, default True
mass : Bool, default False
remap : Bool, default False
dtype : str, default ‘ndarray’
frame_indices : {None, array-like}, default None
|
---|
Examples
>>> import pytraj as pt
>>> traj = pt.load("TYR.nc", "TYR.parm7")
>>> data = pt.symmrmsd(traj, ref=0)
Notes
-----
versionadded: 1.0.6