GMPavanLab / Swarm-CG

Swarm-CG: Automatic Parametrization of Bonded Terms in MARTINI-based Coarse-Grained Models of Simple to Complex Molecules via Fuzzy Self-Tuning Particle Swarm Optimization
https://pubs.acs.org/doi/10.1021/acsomega.0c05469
MIT License
42 stars 10 forks source link

VirtualSites are silently dropped from itp #1

Open fgrunewald opened 4 years ago

fgrunewald commented 4 years ago

Hi,

First of all I want to say that this is a very interesting project. I'm very much looking forward to using the program in some high throughout parametrization of models. However, it seems that the program fails to include virtual sites. I assume they are dropped because they cannot be optimized. However, the program also does not issue a warning or error message at the pre process stage.

From a martini centric perspective it would be very useful to have the code simply keep virtual sites, because a lot of martini3 models are using virtual sites. Can this be implemented in the current code?

EDIT: Actually after hacking in VS treating them like exclusions, I figured out that this will not be possible to have because MDAnalysis make whole does not support making whole molecules that have VS (i.e. not contiguous bonds).

CharlyEmpereurmot commented 4 years ago

Hello,

Thank you for your interest in this project. It is still in its early days and we have not extensively tested all use cases, notably with virtual sites. Also refactoring is on-going, which we expect will ease the inclusion of more potential functions + usage with different MD engines.

In principle there is no reason VS cannot be optimized for bonded. One of the interesting aspect of Swarm-CG is that it relies on FST-PSO to optimize as many objects (bonds/angles/dihedrals) as the topology defines, while still offering some guarantee about the structure of the CG model, even for big molecules with nested topologies.

We will look into usage with VS very soon and include this in the next release. According to what you are saying, I think we need to read the ITP to find bonds involving VS and create these bonds in the MDAnalysis universe if they do not exist, before calling make_whole.

Could you please attach here the input files you are using ? Or send via email at charly.empereur@gmail.com. You could make the trajectory ~100 frames if the files are too heavy, it's just for testing.

fgrunewald commented 4 years ago

Hi,

According to what you are saying, I think we need to read the ITP to find bonds involving VS and create these bonds in the MDAnalysis universe if they do not exist, before calling make_whole.<

Pretty much yes. Essentially VS are constructed by geometric rules from other atoms. So in that sense they are not bonded by constraints or bonds to any other atom. They cheap option would then indeed be to put "dummy" bonds into the MDAnalysis universe and then call make whole. On the other hand the cleaner option would be to fix this in MDAnalysis. It shouldn't be too hard.

Regarding the files, I'll prepare an example setup for you of a similar system. I cannot share the exact input parameters because they are currently in the process of publication.

CharlyEmpereurmot commented 3 years ago

Hello,

So it should be working fine now, starting from version 1.1.7 all virtual sites functions are properly handled. We also added the option to interpret a mapping file using either center of mass (COM) or center of geometry (COG). The latter seems to be increasingly used in the context of MARTINI 3. You can upgrade to version >= 1.1.7 from pypi.

Please let us know if it works for you ! And don't hesitate if you find any strange behavior, or if you think about new useful features :)

fgrunewald commented 3 years ago

Hi,

Thanks for dealing with this issue. It took me a while to circle back to this, but I just tested the recent version 1.1.8 and I still find a couple of issues: