BartBruininks / mdvwhole

Density based object completion over PBC.
Apache License 2.0
23 stars 2 forks source link

Scaling Artifact for Trajectory whole #44

Open scichemcode opened 3 months ago

scichemcode commented 3 months ago

mdvwhole -f Insulin-Dimer_3W7Y_DES-Amber_NPT_300K.part0020.only-protein.gro -x Insulin-Dimer_3W7Y_DES-Amber_NPT_300K.part0020.only-protein.xtc -o Insulin-Dimer_3W7Y_DES-Amber_NPT_300K.part0020.only-protein_whole.xtc

This on being run gives A scaling artifact has occured of more than 0.05% deviation from the target resolution in frame 0 was detected. You could consider increasing the resolution

Can you help me on this?

BartBruininks commented 3 months ago

Sure can!

Solution

A simple fix would be to explicitly add the resolution of the voxel sampling. By using the -res flag. And adding a negative sign in front of the resolution (in the example i use a resolution of 0.5 nm but 1 nm is also quite common).

Example

mdvwhole -f Insulin-Dimer_3W7Y_DES-Amber_NPT_300K.part0020.only-protein.gro -x Insulin-Dimer_3W7Y_DES-Amber_NPT_300K.part0020.only-protein.xtc -o Insulin-Dimer_3W7Y_DES-Amber_NPT_300K.part0020.only-protein_whole.xtc -res -0.5 

Explanation:

The issue is that due to PBC the total volume of the space is finite. We would like to tile this space regurlarly with a voxel of a certain size. However this means our voxel size has to fit in the box an integer amount of times. Since both the box size and voxel size are up to the user, this is not simply satisfied. To make it possible we scale the actual resolution slightly, for a large anough box a small change is usually enough. However for smaller systems the deviation can be noticeable (an error is thrown if the deviation is more than 5%). This error is ignored when using a minus sign in front of the resolution (not the most intuïtieve I agree).

I hope this clarifies things and this resolves your problem.

scichemcode commented 3 months ago

Interesting. The problem you dealt really needs guts. Thanks a lot for the revert.