-
Notifications
You must be signed in to change notification settings - Fork 2
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
Itp generation #28
base: main
Are you sure you want to change the base?
Itp generation #28
Conversation
…a mapped trajectory. bond file takes ~itp structure of listing sets of atom names within a directive, eg [ bonds ] AT1 AT2 [ angles ] AT1 AT2 AT3 etc
…e flag so don't need topology ahead of time
…d on force constant
note to self, the dihedral angle calculation isn't quite right atm, need to correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I'd say this is a very good first draft. I've made some comments on details. For the big picture I'm wondering if: A) Should we use vermouth molecules all throughut the fitting? This change would probably simplify some of the handling; B) should we use the bond input file or directly start from an itp file? I prefer the latter but understand that especially new users find this difficult
cli: - -plot-data argument writes out data to make fitted distribution plots if given - -precision specifies precision of values in output itp other: - moved plot making to its own function - tidied interaction fitting using function dictionary - changed histogram making to have fixed bins for interaction type - changed atom mass to dictionary
…nput files. Automatically adds comments to interactions to read into ff_inter
…itp generation on top. interactions_to_itp.py modified accordingly. other minor changes for error handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall already pretty good. Some clean up and refinement of some bits is still in order. And I haven't tested it yet, but will report on that later during the day.
I'm still torn on the template generation thing and have been thinking, if we can recycle some of the functionality in vermouth. I think the vermouth ff format accepts a reduced block that only specifies residue names and bead names. We could then make the input file an ff file and potentially run (part of) DoLinks. I need to play a bit with it and let you knwo
bins_dict = {"bonds": np.arange(time_series.min()-0.1, time_series.max()+0.1, 0.01), | ||
"angles": np.arange(181), | ||
"dihedrals": np.arange(-180, 181) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure on the best cause of action here either. However, I think we might want to make this dict a package wide variable by moving it outside the function name space and calling it BINS_DICT
. In principle if someone was to overwrite it they could access it.
-sort out copyright notices
The fitting of angles is broken. |
angle fitting is now fine. However for some reason constraints are written twice in the output itp. need to fix this |
also currently the |
Finally, we should be able to read itps without comments, autogenerate interactions lists, and calculate them from that |
@csbrasnett yes, maybe, yes, but let's split this in two or three separate PRs. Especially, dropping the tpr information comes with it's own set's of caveats since one needs the residue information and how many molecules there are in the system of which lengths |
@fgrunewald yep no worries, I was mainly brain dumping for the moment! I'll definitely fix the constraints being doubly written here, the others we can deal with elsewhere |
@fgrunewald this will now autogenerate the lists with no need for the comments. I'll do the tpr stuff in a separate branch, if I have time |
Generate itps from mapped trajectories.
Use the existing interactions code to generate distributions of interactions, then use a boltzmann inversion to find values for an itp.
interactions are defined in an input file with bead names corresponding to the mapped beads.
CLI updates:
-b
: path for a file containing information about atomtypes, bonds, angles, etc.-p
: if given, plots of fitted distributions will be saved-name
: name of molecule to be used for output itp-constraints
: force constant above which to convert bonds to constraints