Re: [AMBER] Unwrapping in MSD calculations with pytraj/cpptraj

From: Daniel Roe via AMBER <>
Date: Fri, 29 Jul 2022 15:49:55 -0400


I think I see the behavior you are seeing. I need to look into it more
and I'll update you with what I find.

What kind of unit cell are you using? Also, what versions of cpptraj
and pytraj are you using?



On Mon, Jul 25, 2022 at 8:58 AM Cianna Calia via AMBER
<> wrote:
> Hello AMBER community!
> I am wondering if anyone can help me understand how the diffusion functions
> in pytraj/cpptraj handle unwrapping. When I try using pytraj to calculate
> an atom's MSD from a trajectory unwrapped in cpptraj (with "unwrap
> byatom"), I am unsure why it deviates from pytraj's result for the original
> wrapped trajectory, since I thought pytraj would deal with unwrapping
> automatically in a way that would give the same result as using the already
> unwrapped trajectory. But the X, Y, and Z datasets differ starting where
> unwrapping becomes relevant for each dimension.
> More detail - I have the original wrapped trajectory
> and an unwrapped trajectory
> made in cpptraj like this:
> parm 1hg7_WT_cubic.prmtop
> trajin
> unwrap byatom
> trajout
> I tried the following diffusion calculations with pytraj:
> import pytraj as pt
> original_traj = pt.load('',
> '1hg7_WT_cubic.prmtop')
> pt_diffusion_orig_traj = pt.diffusion(original_traj, '.1730', dtype='dict',
> frame_indices=[i for i in range(len(original_traj))])
> unwrapped_traj = pt.load('', '1hg7_WT_cubic.prmtop')
> pt_diffusion_unw_traj = pt.diffusion(unwrapped_traj, '.1730', dtype='dict',
> frame_indices=[i for i in range(len(unwrapped_traj))])
> I am hoping for clarification on why pt_diffusion_orig_traj and
> pt_diffusion_unw_traj are not the same.
> I observe the same situation when I do analogous calculations with cpptraj
> as opposed to pytraj. I also tried seeing how the noimage option with the
> cpptraj diffusion function affects the results, and I am similarly confused
> about why the two diffusion calculations below give different results
> (again, differing starting from where there's unwrapping):
> parm 1hg7_WT_cubic.prmtop
> trajin
> diffusion out orig_traj_1730_diff_cpptraj.dat time 1.0 ".1730" nocalc
> unwrap byatom
> diffusion out unwrapped_traj_1730_diff_cpptraj.dat time 1.0 noimage ".1730"
> nocalc
> Taking out the "byatom" option makes no noticeable difference, nor does
> removing the "noimage" option from the diffusion command acting on the
> already unwrapped trajectory. The difference between the diffusion data
> before and after unwrapping here is not the same as the difference I
> observe when I use the diffusion command on the original wrapped trajectory
> with vs. without the "noimage" option.
> Thanks in advance for any help with understanding this!
> Cianna Calia
> _______________________________________________
> AMBER mailing list

AMBER mailing list
Received on Thu Aug 04 2022 - 13:37:44 PDT
Custom Search