Hi,
Thanks for the files.
I looked into this in-depth, and cpptraj is calculating the distances
properly. The by-hand calculated distances match the ones calculated
by cpptraj with imaging off. If I omit the 'noimage' keyword for
'distance' I get the shorter distance that you reported, which is also
correct but is the minimum imaged distance (as I stated before). I
will attach the script I used to test everything and paste the output
below.
So to sum up, make sure you specify the 'noimage' keyword to the
'distance' command if what you want is the non-imaged distance.
-Dan
[droe.de6 2025-05-19_Distance] (master)$ ./Test.sh eq_snapshot_1.pdb
ATOM 14005 CA ASP 923 -47.876 63.644 13.297 1.00 0.00 C
ATOM 22425 CA ALA 1479 111.241-129.062-121.078 1.00 0.00 C
Info: Redirecting output to file 'cpptraj1.out'
#Frame ASP923
1 -47.8760 63.6440 13.2970 0.0000 0.0000 0.0000
#Frame ALA1479
1 111.2410 -129.0620 -121.0780 0.0000 0.0000 0.0000
-47.8760 63.6440 13.2970
111.2410 -129.0620 -121.0780
Sum= 80510.46275000
Dist= 283.74365675729210916086
#Frame d1
1 283.7437
#Frame d1imaged
1 164.9428
[droe.de6 2025-05-19_Distance] (master)$ ./Test.sh eq_snapshot_1000.pdb
ATOM 14005 CA ASP 923 -50.609 64.766 15.226 1.00 0.00 C
ATOM 22425 CA ALA 1479 117.407-129.156-107.371 1.00 0.00 C
Info: Redirecting output to file 'cpptraj1.out'
#Frame ASP923
1 -50.6090 64.7660 15.2260 0.0000 0.0000 0.0000
#Frame ALA1479
1 117.4070 -129.1560 -107.3710 0.0000 0.0000 0.0000
-50.6090 64.7660 15.2260
117.4070 -129.1560 -107.3710
Sum= 80865.14274900
Dist= 284.36797068059546146633
#Frame d1
1 284.3680
#Frame d1imaged
1 162.9013
[droe.de6 2025-05-19_Distance] (master)$ ./Test.sh eq_snapshot_2500.pdb
ATOM 14005 CA ASP 923 -52.292 65.593 25.838 1.00 0.00 C
ATOM 22425 CA ALA 1479 116.039-138.392-131.288 1.00 0.00 C
Info: Redirecting output to file 'cpptraj1.out'
#Frame ASP923
1 -52.2920 65.5930 25.8380 0.0000 0.0000 0.0000
#Frame ALA1479
1 116.0390 -138.3920 -131.2880 0.0000 0.0000 0.0000
-52.2920 65.5930 25.8380
116.0390 -138.3920 -131.2880
Sum= 94633.78566200
Dist= 307.62604841267912369646
#Frame d1
1 307.6260
#Frame d1imaged
1 139.3277
On Sun, May 18, 2025 at 1:21 AM Michael Shokhen via AMBER
<amber.ambermd.org> wrote:
>
> Hi Dan,
>
> As per your request, I am sending you a compressed ZIP file of the topology. I have also generated three PDB files corresponding to the MD trajectory snapshots: 1, 1000 and 2500.
> These compressed ZIP files are each 30.7 MD in size, so I am sending them in three separate emails. Please let me know if I have missed any of the requested data and I will send them to you.
>
> All the best,
> Michael
>
>
> *****************************
> Michael Shokhen, PhD
> Associate Professor
> Department of Chemistry
> Bar Ilan University,
> Ramat Gan, 52900
> Israel
> email: michael.shokhen.biu.ac.il<https://webmail.biu.ac.il/owa/redir.aspx?C=a160ef9b9a6b4d06992402715d3ee465&URL=mailto%3ashokhen%40mail.biu.ac.il>
> ________________________________
> From: Daniel Roe <daniel.r.roe.gmail.com>
> Sent: Saturday, May 17, 2025 4:52 PM
> To: Michael Shokhen <michael.shokhen.biu.ac.il>
> Cc: amber.ambermd.org <amber.ambermd.org>
> Subject: Re: [AMBER] Fw: There seems to be a bug in the CPPTRAJ software
>
> Hi,
>
> No need for something so elaborate. Just send me off-list the topology
> and a few trajectory frames which illustrate the issue. Let me know if
> you need help generating the smaller trajectory.
>
> -Dan
>
> On Sat, May 17, 2025 at 7:54 AM Michael Shokhen
> <michael.shokhen.biu.ac.il> wrote:
> >
> > Hi Dan,
> >
> > I am using the AMBR24 package which includes the CPPTRAI software.
> > I could not determine the version number of the latter.
> > In the PDB file, the first residue of the protein is residue #1 and then
> > the numbering of the protein residues increases by 1 until the last residue
> > is #1488 followed by the solvent components: 1382 Na+, 1394 Cl- and Wat 51544 Wat.
> > The whole system contains 1571688 atoms.
> > Thank you very much for your kind offer to identify the CPPTRAJ problem I was facing.
> > In order to provide you with the required files, I have collected them in one directory.
> > I am using AWS cloud server for AMBER24 calculations. The whole system is quite large,
> > so the total directory I have prepared for submission is 47.6 GB.
> > Next week, I will ask the AWS system manager to prepare the password and instruction
> > on how you can download the files form AWS server. I will send you the details to your email.
> >
> > Thanks again,
> > Michael
> >
> > ________________________________
> > From: Daniel Roe <daniel.r.roe.gmail.com>
> > Sent: Friday, May 16, 2025 9:04 PM
> > To: Michael Shokhen <michael.shokhen.biu.ac.il>; AMBER Mailing List <amber.ambermd.org>
> > Subject: Re: [AMBER] Fw: There seems to be a bug in the CPPTRAJ software
> >
> > Also keep in mind that PDB residue numbering does not necessarily
> > match up with topology residue numbering. By convention Amber will
> > number residues starting from 1 to N, where N is the total number of
> > residues in the system. Unless your PDB also has the first residue as
> > residue 1 and then increases by 1 each residue, the numbering may not
> > match up.
> >
> > If you've added PDB information to your topology (with e.g. parmed) or
> > you are using a PDB file with the original residue numbering as your
> > topology you can specify using the original (PDB) residue numbering
> > with the ':;' (colon semicolon) operator instead of ':' (colon).
> >
> > If you still can't figure it out you'll have to provide me with some
> > files I can use to try and reproduce whatever issue. Also, let me know
> > the version of cpptraj you are using.
> >
> > -Dan
> >
> > On Fri, May 16, 2025 at 12:59 PM Michael Shokhen via AMBER
> > <amber.ambermd.org> wrote:
> > >
> > > ________________________________
> > > From: Michael Shokhen <michael.shokhen.biu.ac.il>
> > > Sent: Friday, May 16, 2025 7:34 PM
> > > To: Daniel Roe <daniel.r.roe.gmail.com>
> > > Subject: Re: [AMBER] There seems to be a bug in the CPPTRAJ software
> > >
> > > Hi Dan,
> > >
> > > Many thanks for your fast response.
> > > Following your advise I used the "noimage" keyword.
> > > Unfortunately, it doesn't help.
> > > See the attached files.
> > >
> > > Michael
> > >
> > > *****************************
> > > Michael Shokhen, PhD
> > > Associate Professor
> > > Department of Chemistry
> > > Bar Ilan University,
> > > Ramat Gan, 52900
> > > Israel
> > > email: michael.shokhen.biu.ac.il<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebmail.biu.ac.il%2Fowa%2Fredir.aspx%3FC%3Da160ef9b9a6b4d06992402715d3ee465%26URL%3Dmailto%253ashokhen%2540mail.biu.ac.il&data=05%7C02%7Cmichael.shokhen%40biu.ac.il%7C332c958aab2d4f19484208dd954a261a%7C61234e145b874b67ac198feaa8ba8f12%7C0%7C0%7C638830867886413362%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=othBD3MunwCAb0jPrLrUdJXs8AIWesCkOe13%2FLriln0%3D&reserved=0>
> > > ________________________________
> > > From: Daniel Roe <daniel.r.roe.gmail.com>
> > > Sent: Friday, May 16, 2025 7:08 PM
> > > To: Michael Shokhen <michael.shokhen.biu.ac.il>; AMBER Mailing List <amber.ambermd.org>
> > > Subject: Re: [AMBER] There seems to be a bug in the CPPTRAJ software
> > >
> > > Hi,
> > >
> > > My guess is that the distance calculated by cpptraj is not wrong, it's
> > > just not what you expect. By default, when periodic boundary
> > > conditions are present, cpptraj reports the shortest distance between
> > > the two specific masks according to the minimum image convention (see
> > > the 'distance' command entry in the cpptraj manual). If you don't want
> > > imaged distances, specify the 'noimage' keyword.
> > >
> > > Hope this helps,
> > >
> > > -Dan
> > >
> > > On Fri, May 16, 2025 at 11:45 AM Michael Shokhen via AMBER
> > > <amber.ambermd.org> wrote:
> > > >
> > > > CPPTRAJ in AMBER24 incorrectly calculates the CA-CA distance between amino acid residues in a protein.
> > > > I used the AMBER24 molecular dynamics simulation of a large protein containing 1488 residues. The initial conformation of the protein is very extended. After several standard geometry optimization steps in a periodic rectangular water box also containing Na+ Cl- ions at physiological concentration, I used a short conventional molecular dynamics simulation of 5 ns duration to equilibrate the whole system:
> > > > equilibrate 5ns
> > > > &cntrl
> > > > imin=0,irest=1,ntx=5,
> > > > nstlim=2500000,dt=0.002,
> > > > ntc=2,ntf=2,ig=-1,
> > > > cut=8.0, ntb=2, ntp=1, taup=2.0,
> > > > ntpr=1000, ntwx=1000,
> > > > ntt=3, gamma_ln=2.0,
> > > > temp0=310.0,
> > > > /
> > > > In the next step, I used the CPPTRAJ script cpptr_dist.in to calculate the CA-CA distance value between residues ASP923 and ALA1479 in the last 2500 snapshot:
> > > >
> > > > # Distance analysis with cpptraj.
> > > > # Load topology trajectory
> > > > parm ../mc.prmtop
> > > > trajin ../6_/eq.mdcrd 2500 2500
> > > > strip :WAT,Cl-,Na+
> > > > autoimage origin
> > > > distance ASP923_ALA1479 :923.CA :1479.CA out dist_CA-CA_ASP923_ALA1479_eq_2500.agr
> > > > run
> > > > The result is as follows:
> > > > with g0
> > > > xaxis label "Frame"
> > > > yaxis label ""
> > > > legend 0.2, 0.995
> > > > legend char size 0.60
> > > > s0 legend "ASP923_ALA1479"
> > > > target G0.S0
> > > > type xy
> > > > 1.000 139.327
> > > >
> > > > I then used the CPPTRAJ script cpptr_pdb.in to generate a PDB file (If needed I'll send the PDB file by request) from the RST file containing the final 3D structure after the 5 ns MD simulation:
> > > >
> > > > parm ../mc.prmtop
> > > > trajin eq.rst
> > > > autoimage origin
> > > > trajout eq_5ns.pdb pdb
> > > > run
> > > > quit
> > > >
> > > > The next two lines contain the XYZ coordinates of the two CA target atoms copied from the PDB file:
> > > >
> > > > ATOM 14005 CA ASP 923 -52.292 65.593 25.838
> > > > ATOM 22425 CA ALA 1479 116.039 -138.392 -131.288
> > > > The target CA-CA distance calculated from PDB coordinates is 307.626 A. The corresponding CA-CA distance value generated by CPPTRAJ is 139.327 A, which is completely wrong!
> > > > There seems to be a bug in the CPPTRAJ software.
> > > > I need to use CPPTRAJ to analyze CA-CA distance variations during long
> > > > MD production simulations.
> > > > I would appreciate help from AMBER experts in fixing this issue.
> > > > Thank you,
> > > > Michael
> > > >
> > > >
> > > >
> > > > *****************************
> > > > Michael Shokhen, PhD
> > > > Associate Professor
> > > > Department of Chemistry
> > > > Bar Ilan University,
> > > > Ramat Gan, 52900
> > > > Israel
> > > > email: michael.shokhen.biu.ac.il<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebmail.biu.ac.il%2Fowa%2Fredir.aspx%3FC%3Da160ef9b9a6b4d06992402715d3ee465%26URL%3Dmailto%253ashokhen%2540mail.biu.ac.il&data=05%7C02%7Cmichael.shokhen%40biu.ac.il%7C332c958aab2d4f19484208dd954a261a%7C61234e145b874b67ac198feaa8ba8f12%7C0%7C0%7C638830867886432026%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=y6KcIZ4hvFGGKd0ZB73VOzhyjgMQAzgpm5STWLwT7Is%3D&reserved=0>
> > > > _______________________________________________
> > > > AMBER mailing list
> > > > AMBER.ambermd.org
> > > > https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.ambermd.org%2Fmailman%2Flistinfo%2Famber&data=05%7C02%7Cmichael.shokhen%40biu.ac.il%7C332c958aab2d4f19484208dd954a261a%7C61234e145b874b67ac198feaa8ba8f12%7C0%7C0%7C638830867886444477%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=MrVCAKWQj8Or3h7e2bzrjZ92ZTu9l1hHAXaXoD6WVS4%3D&reserved=0<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.ambermd.org%2Fmailman%2Flistinfo%2Famber&data=05%7C02%7Cmichael.shokhen%40biu.ac.il%7C332c958aab2d4f19484208dd954a261a%7C61234e145b874b67ac198feaa8ba8f12%7C0%7C0%7C638830867886456630%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=aS3NaJSwfHoseyPWceta0FW2t0PdbZu%2FN4jFJKcBYCY%3D&reserved=0><http://lists.ambermd.org/mailman/listinfo/amber>
> > > _______________________________________________
> > > AMBER mailing list
> > > AMBER.ambermd.org
> > > https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.ambermd.org%2Fmailman%2Flistinfo%2Famber&data=05%7C02%7Cmichael.shokhen%40biu.ac.il%7C332c958aab2d4f19484208dd954a261a%7C61234e145b874b67ac198feaa8ba8f12%7C0%7C0%7C638830867886468544%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=bykDKXnXfWqUQ6VfNqVeXn7iFqITCCWlmVTckkLKL3g%3D&reserved=0<http://lists.ambermd.org/mailman/listinfo/amber>
> _______________________________________________
> 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
- application/x-shellscript attachment: Test.sh
Received on Mon May 19 2025 - 11:00:02 PDT