Skip to content
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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Itp generation #28

wants to merge 25 commits into from

Conversation

csbrasnett
Copy link
Collaborator

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

@csbrasnett
Copy link
Collaborator Author

note to self, the dihedral angle calculation isn't quite right atm, need to correct

Copy link
Owner

@fgrunewald fgrunewald left a 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.
Copy link
Owner

@fgrunewald fgrunewald left a 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

Comment on lines 25 to 28
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)
}
Copy link
Owner

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
@lgruenewald
Copy link
Contributor

The fitting of angles is broken.
Angles are given the same minimum angle and the force constants are not correct.

@csbrasnett
Copy link
Collaborator Author

angle fitting is now fine. However for some reason constraints are written twice in the output itp. need to fix this

@csbrasnett
Copy link
Collaborator Author

also currently the -s flag must be given a .tpr file so the universe can read topology information. this is annoying and we should be more flexible about it

@csbrasnett
Copy link
Collaborator Author

Finally, we should be able to read itps without comments, autogenerate interactions lists, and calculate them from that

@fgrunewald
Copy link
Owner

@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

@csbrasnett
Copy link
Collaborator Author

@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

@csbrasnett
Copy link
Collaborator Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants