Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift in grid-based calculations #1127

Open
choutkaj opened this issue Jan 9, 2025 · 4 comments
Open

Shift in grid-based calculations #1127

choutkaj opened this issue Jan 9, 2025 · 4 comments

Comments

@choutkaj
Copy link

choutkaj commented Jan 9, 2025

Hi all,

I am running GIST on some small molecules and the resulting maps for all the calculated quantities are shifted in space relative to the solute. I am getting this issue with both gist and grid commands. The amount of shift depends on grid spacing (voxel size). With gridspacn 0.1 the shift is almost not noticeable, but the higher gridspacn the more the maps deviate from the solute. Even with default gridspacn 0.5 the maps are quite notably off. See the attached picture for examples of O density around benzene and acetonitrile with different gridspacn values.

The trajectories were generated in OpenMM. I am getting this issue both when I wrap the trajectory in OpenMM (enforcePeriodicBox=True) or keep in unwrapped and then wrap (autoimage) in CPPTRAJ. I am even getting this issue when I run gist from the beginning of an unwrapped trajectory (before the waters float away). So I don’t think it's caused by wrapping. I have tried different sizes of the simulation box and different sizes and centers of GIST boxes, but the issue is still the same.

CPPTRAJ input looks like this with wrapping and rms to the original solute position:

parm solvated_system.prmtop
trajin trajectory.dcd
autoimage
reference solvated_system.pdb
rms reference :1
gist gridcntr 15.0 -10.0 -15.0 griddim 25 25 25 gridspacn 0.5 out gist.out
go

and like this with no wrapping:

parm solvated_system.prmtop
trajin trajectory.dcd
gist gridcntr 15.0 -10.0 -15.0 griddim 25 25 25 gridspacn 0.5 out gist.out
go

I don’t think my problem is related to #198 as I have identical grids in both gist and grid, that doesn’t seem to be the problem either. I am using CPPTRAJ V6.18.1 (AmberTools) and OpenMM 8.2.0, both installed via micromamba.

Any ideas where the problem might be?

Many thanks,
Jan

benzene_acetamide_gist

@drroe
Copy link
Contributor

drroe commented Jan 9, 2025

In addition to imaging, the autoimage action performs centering (the anchor molecule is placed in the center of the box by default and all other molecules are adjusted accordingly); I'm guessing this is the cause of the discrepancy.

@choutkaj
Copy link
Author

choutkaj commented Jan 9, 2025

Wrapping doesn't seem to be the culprit. I have the same problem even when I don't use any imaging/wrapping at all (as in the second code block). Of course in such case the actual GIST energies are wrong as the waters "float away", but it enables me to rule out the effect of wrapping.

The following picture is Esw-dens calculated around acetamide from a completely unwrapped trajectory, meaning enforcePeriodicBox=False in OpenMM and then this CPPTRAJ input:

parm solvated_system.prmtop
trajin trajectory.dcd 1 500
gist gridcntr 15.0 -10.0 -15.0 griddim 25 25 25 gridspacn 0.50 out gist_unwrapped_05.out
go

@drroe
Copy link
Contributor

drroe commented Jan 9, 2025

Sorry, I think I didn't understand what your issue was initially.

Try adding the bincenter keyword for one of the DX files and see if that gives you the result you expect. E.g.

gist nopme doorder refdens 0.033422885325 gridcntr 1.5 1.0 0.0 \
    griddim 34 44 36 gridspacn 0.50 prefix Gist2 info Info.dat nocom
go
datafile  Gist2-gH.dx bincenter
writedata

If that works, you can do the same for the other files you want shifted. If this is indeed the issue, I can work on implementing a simpler solution.

@choutkaj
Copy link
Author

Yes! Calling datafile <filename> bincenter and writing it into dx does appear to solve the problem. The solute is now correctly positioned relative to the maps. Thank you.

Question: does this affect the computed GIST energies and entropies, or is it just a visualization thing?

acetamide_Esw_bincenter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants