marrink-lab / vermouth-martinize

Describe and apply transformation on molecular structures and topologies
Apache License 2.0
95 stars 43 forks source link

Infinite, periodic molecules #42

Open pckroon opened 6 years ago

pckroon commented 6 years ago

We should be able to support things like infinite DNA chains in the (near) future. To implement this we'll need to become PBC/box aware when we make the initial bonds. The rest should follow automagically.

From the GMX userlist:

Hi,

I'm trying to create a topology for DNA with periodically connected ends. There's a previous message on this, with advice by Justin: https://mailman-1.sys.kth.se/pipermail/gromacs.org_gmx-users/2015-April/096970.html

I have a single-stranded DNA structure in a pdb file with a phosphate on one end (P, OP1, OP2) and an oxygen on the other (O3'). These are exactly the atoms I want to connect later on. I use pdb2gmx to get the hydrogens + topology and give it -ter "none", which gives me the error message

"Fatal error: There is a dangling bond at at least one of the terminal ends. Fix your coordinate file, add a new terminal database entry (.tdb), or select the proper existing terminal entry."

I added the flag -missing (according to Justin's advice), but does not help. I guess I'm not understanding what bond is dangling here, and what to add to the tdb file that would help?

Of course, I could get most of the topology I need by avoiding selecting -ter 'none' but then I have to fiddle with adding back atoms.

Best, Viveca -- Gromacs Users mailing list

jbarnoud commented 6 years ago

We need a way of adding arbitrary bonds anyway (I need it to bind the heme to the hemoglobin for instance), using such mechanics to let the user add the bonds through periodic images would also allow periodic molecules (at least the simplest) without implementing anything extra. At least a solution for the short term.

Being PBC aware is a good idea anyway, and we will need that latter to build more complex multi molecule systems.

Tsjerk commented 6 years ago

I wouldn't call this an 'arbitrary bond'. That's a different league. Yes, we need to be PBC aware for building systems and converting whole systems (forward or backward), and with PBC and the graph-based linking approach, creating periodic molecules becomes easy:

  1. If the molecule appears linked over PBC (bonding aligns near-perfectly) then link ends over PBC (note in log)
  2. If the user specifies not to link, but molecules appears linked, give a warning
  3. If the user specifies a link, but the PBC does not really support it, give a warning 3a. If the user specifies a link, but the PBC really does not support it, give a big warning (unless a cyclic molecule would do... then a problem arises if it's not clear if the user want cyclic or periodic, but that difference is filled in by Gromacs anyway)

To short-cut this now, it would probably do to pass a 'periodic' flag to the molecule, based on user input, where we make sure that at a later point the flag an also be automagically derived from the structure and PBC on a per-chain basis.

fgrunewald commented 2 years ago

since we commited to scipy kdtree, we should be able to find and create periodic bonds IF we propagate the box dimensions. Only issue would be with triclinic boxes. But already much better than what we have now