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

From: Daniel Roe via AMBER <>
Date: Fri, 9 Sep 2022 15:56:28 -0400


On Wed, Sep 7, 2022 at 12:59 AM Cianna Calia <> wrote:
> Thanks for the recommendation about stfcdiffusion! I've read the manual's info on this but I'm still not entirely clear on how it works - Does it define the atoms to calculate MSD for based on distance from mask2 only at an initial/reference frame and then follow those atoms through the trajectory regardless of whether they stay within the distance range? (In which case how would it be different from using the usual diffusion command with a distance-based mask that chooses the atoms based on the distances at a reference frame?) Or does stfcdiffusion not select atoms based on the region but rather only calculate MSD for whatever selected atoms while they are within the region? (In which case how does it handle when different atoms go in and out of the defined region?)

I think it's the latter (only follows atoms while they're in the
region). I think it won't track individual stats - just when a water
enters the region it contributes to the diffusion until it leaves.
Does that make sense?

Next week I'll take a stab at making this work with the current
diffusion command.


> Many thanks,
> Cianna
> On Tue, Sep 6, 2022 at 7:45 AM Daniel Roe <> wrote:
>> Hi,
>> On Fri, Sep 2, 2022 at 12:51 PM Cianna Calia <> wrote:
>> >
>> > That does make sense, thanks a lot for the explanation!
>> >
>> > But then this confuses me with regard to how to correctly do the type of analysis I was trying - I'm attempting to get MSD values from water Os near different residues of my protein (see left column of pg. 17894 of this paper;!!Mih3wA!CIRI0nNUMUlSb_25_oC_IeM6ErxLCDF4PHg4vwdXGYKlYzKAfRDZsEJASKJZva2PsUiCfR75zpZ-Qkc5JlJH$ if more detail is useful). To assess water diffusion with respect to the protein, it seems to me like the protein would need to be held still, either via some post-processing of the trajectory or by using a simulation where the backbone was restrained... Am I thinking along the right lines here?
>> In that case you should probably try the 'stfcdiffusion' command which
>> is a diffusion calculation written by Hannes Loeffler from STFC
>> Daresbury, in which you can supply a second mask (via 'mask2 <mask2>')
>> and an upper and lower bounds (via 'upper <upper>' and 'lower
>> <lower>') to calculate diffusion within a region from <mask2> bounded
>> by <lower> and <upper> (see the manual for full details). This is
>> functionality I'd like to eventually merge into 'diffusion' but just
>> haven't had the time. I don't think that command takes imaging into
>> account, so you'll want to image beforehand. As long as the regions
>> don't cross the unit cell boundary this should be fine. Hope this
>> helps,
>> -Dan
>> >
>> > Many thanks,
>> > Cianna
>> >
>> > On Fri, Sep 2, 2022 at 5:08 AM Daniel Roe <> wrote:
>> >>
>> >> Hi Cianna,
>> >>
>> >> On Fri, Sep 2, 2022 at 12:08 AM Cianna Calia <> wrote:
>> >> >
>> >> > Hi Dan - I've been trying some more tests with your diffusion function, and I notice that the MSD values are different if I recenter my trajectory with autoimage. I'm not sure why that would be... Is this expected? Any clarification on why this happens would be appreciated - more details below:
>> >>
>> >> Yes, this is expected. The 'autoimage' command centers the system on
>> >> the anchor in addition to imaging, so there is an applied translation
>> >> that is effectively removing the global translation of the anchor from
>> >> the entire system, which is why the diffusion calculation is affected.
>> >> If you just use 'image' (which does not automatically apply a
>> >> translation) instead of 'autoimage' the calculation should be
>> >> unaffected. Does that make sense? Let me know if not.
>> >>
>> >> -Dan

AMBER mailing list
Received on Fri Sep 09 2022 - 13:00:03 PDT
Custom Search