marrink-lab / vermouth-martinize

Describe and apply transformation on molecular structures and topologies
Apache License 2.0
86 stars 38 forks source link

add draft for ff-output #442

Open fgrunewald opened 2 years ago

fgrunewald commented 2 years ago

An initial draft for a ff-file writer. @pckroon some initial feedback would be appreciated. Once the general layout is good, I write tests.

fgrunewald commented 2 years ago

@pckroon the why is easy: Because we already use that in 2 projects relating to automatic link generation from template itp-files. Also it is useful in the API as you can read in ff-files manipulate them not manually and then write the links again e.g. look for all links that do this and change attribute there.

About the corner cases, they are not so bad. The input files are more condensed because of some hacks and tricks but once they are at link level everything gets resolved. The writer will not write the same force-field by line-comparison but a more verbose but also more robust version. For examples all variables should be resolved in the link, they just get written directly to the links.

pckroon commented 2 years ago

@pckroon the why is easy: Because we already use that in 2 projects relating to automatic link generation from template itp-files. Also it is useful in the API as you can read in ff-files manipulate them not manually and then write the links again e.g. look for all links that do this and change attribute there.

Ok, that sounds very reasonable. I personally also like being to both read and write things at the same time.

About the corner cases, they are not so bad. The input files are more condensed because of some hacks and tricks but once they are at link level everything gets resolved. The writer will not write the same force-field by line-comparison but a more verbose but also more robust version. For examples all variables should be resolved in the link, they just get written directly to the links.

This I understand and agree with. But parsing the manual/condensed and the automatic/explicit FF must result in the same FF object. So comparison should be done on parsed FF level indeed. I think you're confusing macros and variables here ;) Macros will be resolved upon parsing and are invisible to the FF object. Variables are not.