Re: [AMBER] Problem Imaging atoms of system crossing the PBC box from opposite faces of box at the same time

From: Daniel Roe <daniel.r.roe.gmail.com>
Date: Wed, 28 Jun 2017 08:45:56 -0400

Hi,

It turns out there wasn't a bug here, but I did have to create a new
command: 'fiximagedbonds' (details below). The new command is
available in the GitHub version of cpptraj:
(https://github.com/Amber-MD/cpptraj).

The 'unwrap' command relies on having a reference structure that is
not too different from the frames you want to unwrap. Based on the
files you gave me you can see that in the first frame of the
trajectory the protein (residues 1 to 286) appears to be rotated about
90 degrees with respect to the reference. Therefore it appears that
the atoms travel huge distances from the reference to the first frame
and 'unwrap' can't make heads or tails of it. It's particularly
problematic since imaging was done by atom, so you end up "breaking"
bonds. The 'fiximagedbonds' command will restore structures that have
been imaged this way. Basic usage is:

fiximagedbonds [<mask>]

Using this new command I was able to properly re-image your trajectory
using the following cpptraj input:

parm 0P.com.wat.leap.prmtop
trajin 0P.com-sample-frames.nc
fiximagedbonds
autoimage
trajout reimage.nc

Note that I place an 'autoimage' command after 'fiximagedbonds'. This
is because the way cpptraj fixes the imaged bonds it can lead to
structures that appear to be outside the box. Once the bonds have been
fixed 'autoimage' works as intended. Also note that it appears that
the waters in your system are not imaged by atom. If this is the case
(i.e. if the water will never have broken bonds) the command can be
sped up by excluding the waters, e.g.

fiximagedbonds !:WAT

Please let me know if you get a chance to try it and it works (or
doesn't work). Thanks for the report.

-Dan

PS - GitHub pull request details for those interested here:
https://github.com/Amber-MD/cpptraj/pull/504



On Mon, Jun 26, 2017 at 12:06 PM, Daniel Roe <daniel.r.roe.gmail.com> wrote:
> Thanks for the files, I do see what you mean now. I'm looking into it.
> I'll get back to you (hopefully) soon.
>
> -Dan
>
> On Fri, Jun 23, 2017 at 6:55 AM, SHAILESH KUMAR <shaile27_sit.jnu.ac.in> wrote:
>> Thank you Dan!,
>>
>> Here I am sharing a tar containing following files:
>> 0P.com-sample-frames.nc
>> 0P.com.wat.leap.inpcrd
>> 0P.com.wat.leap.prmtop
>> rst2_acemd.inp
>>
>> autoimage.cpptraj.in
>>
>> Simulation is performed using ACEMD
>> <http://docs.acellera.com/acemd/usermanual/> simulation package.
>> Corresponding file used for input is rst2_acemd.inp
>> wrapping is enabled using
>> warp all
>>
>> It wraps coordinates byatom see here
>> <http://docs.acellera.com/acemd/usermanual/#apply-periodic-boundary-conditions>
>> .
>>
>> Hope it allows to reproduce the problem I am facing.
>>
>> https://drive.google.com/file/d/0BxWg4r6noGsRMVpPWjVMazF1RmM/view?usp=sharing
>>
>> On Thu, Jun 22, 2017 at 9:52 PM, Daniel Roe <daniel.r.roe.gmail.com> wrote:
>>
>>> Can you describe exactly how the intial 'autoimage' did not work? Your
>>> best bet for getting help is to provide your exact input and as
>>> precise a description of the original problem as possible.
>>>
>>> -Dan
>>>
>>> On Thu, Jun 22, 2017 at 12:47 PM, SHAILESH KUMAR <shaile27_sit.jnu.ac.in>
>>> wrote:
>>> > I tried autoimage first as it is suggested in manual, but it did not
>>> > worked. Only after that I tried unwrap & image combination
>>> >
>>> > On Jun 22, 2017 5:57 PM, "Daniel Roe" <daniel.r.roe.gmail.com> wrote:
>>> >
>>> >> What happens if you just 'autoimage' (don't unwrap first)?
>>> >>
>>> >> -Dan
>>> >>
>>> >> On Thu, Jun 22, 2017 at 9:51 AM, SHAILESH KUMAR <shaile27_sit.jnu.ac.in
>>> >
>>> >> wrote:
>>> >> > Dear Fellows,
>>> >> >
>>> >> > I have performed a MD simulation with coordinates wrapping enabled.
>>> Now I
>>> >> > am facing discontinuous trajectory problem. I tried to unwrap
>>> coordinates
>>> >> > and reimage but it did not helped. Investigating about the cause of
>>> >> problem
>>> >> > I found following things.
>>> >> >
>>> >> > 1. PBC Box dimensions: {88.588371 75.344688 67.300514 90.000000
>>> 90.000000
>>> >> > 90.000000}
>>> >> > 2. Protein dimension (distance between coordinates of extreme points
>>> in
>>> >> > protein) as
>>> >> > {63.625731468200684 49.82566452026367 40.63145446777344}
>>> >> >
>>> >> > Unwrapping and Imaging was done as below with cpptraj.
>>> >> >
>>> >> > parm com.wat.leap.prmtop
>>> >> > trajin rst2_out.dcd 1 51000 10
>>> >> > reference ../../../../02.leap/com/com.wat.leap.inpcrd
>>> >> > unwrap byres reference !:1-287
>>> >> > center :123.HE2 mass origin reference
>>> >> > image origin center familiar com :123.HE2 byres !:1-287
>>> >> > unwrap byatom reference :1-287
>>> >> > center :123.HE2 mass origin reference
>>> >> > image origin center familiar com :123.HE2 byatom :1-287
>>> >> > trajout com.strip_cr14.nc
>>> >> > go
>>> >> >
>>> >> > Atom :123.HE2 was nearest protein atom to the center of PBC box in
>>> >> initial
>>> >> > coordinates, hence it was chosen for centering protein to the box.
>>> >> >
>>> >> > Now, problem is that molecule has rotated during the simulation in the
>>> >> box
>>> >> > and hence atoms are crossing two opposite sides of the box at the same
>>> >> > time. So, when it is wrapped these atoms are appearing from opposite
>>> of
>>> >> > actual side it should be, leading to stretches of structure connected
>>> by
>>> >> > bonds length of box-dimension.
>>> >> >
>>> >> > So, I tried to construct a cubic box of side length 20 with is center
>>> at
>>> >> > the center of PBC-box.
>>> >> > as follows.
>>> >> >
>>> >> > Let centre of PBC-box has coordinates {cx cy cz}
>>> >> > then six-set of residues corresponding to residues beyond
>>> inner-cubic-box
>>> >> > faces were selected as
>>> >> >
>>> >> > set rset1 [atomselect top "protein and x < cx - 10"]
>>> >> > set rset1 [atomselect top "protein and x > cx + 10"]
>>> >> > set rset1 [atomselect top "protein and y < cy - 10"]
>>> >> > set rset1 [atomselect top "protein and y > cy + 10"]
>>> >> > set rset1 [atomselect top "protein and z < cz - 10"]
>>> >> > set rset1 [atomselect top "protein and z > cz + 10"]
>>> >> >
>>> >> > Now residues in these sets were unwraped
>>> >> > centering was done with atom closet to the center of corresponding
>>> face
>>> >> of
>>> >> > inner-cubic-box
>>> >> > and image was done for these set of residues. but it dis not work
>>> >> >
>>> >> > Other suggested options were also tried e.g.
>>> >> >
>>> >> > unwrap
>>> >> > autoimage
>>> >> >
>>> >> > with bymol, byres and byatom options with solute mask, all system
>>> mask,
>>> >> but
>>> >> > yet to succeed.
>>> >> >
>>> >> > Any help and suggestions in regard will be greatly appreciated.
>>> >> >
>>> >> > Thank you.
>>> >> >
>>> >> > Image of system with/without box waters shown is attached. If
>>> required, I
>>> >> > can share, prmtop and dcd files with some frames.
>>> >> >
>>> >> > _______________________________________________
>>> >> > AMBER mailing list
>>> >> > AMBER.ambermd.org
>>> >> > http://lists.ambermd.org/mailman/listinfo/amber
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> -------------------------
>>> >> Daniel R. Roe
>>> >> Laboratory of Computational Biology
>>> >> National Institutes of Health, NHLBI
>>> >> 5635 Fishers Ln, Rm T900
>>> >> Rockville MD, 20852
>>> >> https://www.lobos.nih.gov/lcb
>>> >>
>>> >> _______________________________________________
>>> >> AMBER mailing list
>>> >> AMBER.ambermd.org
>>> >> http://lists.ambermd.org/mailman/listinfo/amber
>>> >>
>>> > _______________________________________________
>>> > AMBER mailing list
>>> > AMBER.ambermd.org
>>> > http://lists.ambermd.org/mailman/listinfo/amber
>>>
>>>
>>>
>>> --
>>> -------------------------
>>> Daniel R. Roe
>>> Laboratory of Computational Biology
>>> National Institutes of Health, NHLBI
>>> 5635 Fishers Ln, Rm T900
>>> Rockville MD, 20852
>>> https://www.lobos.nih.gov/lcb
>>>
>>> _______________________________________________
>>> AMBER mailing list
>>> AMBER.ambermd.org
>>> http://lists.ambermd.org/mailman/listinfo/amber
>>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER.ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>
>
>
> --
> -------------------------
> Daniel R. Roe
> Laboratory of Computational Biology
> National Institutes of Health, NHLBI
> 5635 Fishers Ln, Rm T900
> Rockville MD, 20852
> https://www.lobos.nih.gov/lcb



-- 
-------------------------
Daniel R. Roe
Laboratory of Computational Biology
National Institutes of Health, NHLBI
5635 Fishers Ln, Rm T900
Rockville MD, 20852
https://www.lobos.nih.gov/lcb
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Jun 28 2017 - 06:00:06 PDT
Custom Search