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

Converter for OpenMM #2917

Merged
merged 70 commits into from
May 5, 2021
Merged

Conversation

ahy3nz
Copy link
Contributor

@ahy3nz ahy3nz commented Aug 25, 2020

Partially addresses #2863 and #2367

Changes made in this Pull Request:

  • Add topology converters for openmm Simulation, PDBFile, Modeller, PDBxFile, and Topology objects
  • Add coordinate converters for openmm Simulation, PDBFile, Modeller, and PDBxFile objects
  • Tests included

Openmm has a lot of classes that wrap fileformats, but they all have properties for positions (numpy arrays) and topologies (openmm topology). I'm not sure what the "best" way to handle this is, but I went with trying to create one mdanalysis reader class for each openmm object (they end up re-using a lot of functions). Alternatively, could you create a universe from a numpy array of positions + the openmm topology? (if you can, I don't know how) This could be a uniform pattern for converting a lot of openmm objects into mdanalysis universe objects while reducing the number of reader classes.

When testing the openmm Topology reader, I had to specify the topology_format flag -- do the _READERS only infer for coordinate readers?

There's been nothing done with trying to infer angles/dihedrals/etc from the forces within an openmm system. There's also been nothing done with trying to create openmm objects from mdanalysis objects

I tried to adjust some yml files that install from conda. I don't think openmm is available on pip

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

@pep8speaks
Copy link

pep8speaks commented Aug 25, 2020

Hello @ahy3nz! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 29:80: E501 line too long (145 > 79 characters)
Line 34:80: E501 line too long (80 > 79 characters)
Line 36:80: E501 line too long (165 > 79 characters)
Line 37:80: E501 line too long (171 > 79 characters)
Line 38:80: E501 line too long (171 > 79 characters)
Line 43:80: E501 line too long (90 > 79 characters)
Line 105:80: E501 line too long (81 > 79 characters)
Line 115:17: E128 continuation line under-indented for visual indent
Line 141:80: E501 line too long (205 > 79 characters)
Line 159:17: E128 continuation line under-indented for visual indent
Line 171:80: E501 line too long (81 > 79 characters)
Line 194:80: E501 line too long (110 > 79 characters)

Line 31:80: E501 line too long (137 > 79 characters)
Line 32:80: E501 line too long (85 > 79 characters)
Line 37:80: E501 line too long (165 > 79 characters)
Line 38:80: E501 line too long (183 > 79 characters)
Line 39:80: E501 line too long (171 > 79 characters)
Line 40:80: E501 line too long (171 > 79 characters)
Line 42:80: E501 line too long (86 > 79 characters)
Line 189:1: W391 blank line at end of file

Line 166:80: E501 line too long (114 > 79 characters)

Comment last updated at 2021-05-05 15:48:33 UTC

@orbeckst
Copy link
Member

Hi @ahy3nz thanks for giving this one a try. Please be a little patient with the core devs... we're at the end of GSoC and most of the time for reviewing PRs currently goes into getting GSoC PRs wrapped up. You can also email the developer list with questions, sometimes that gets a quick reply, especially if one can answer in a sentence or two. But rest assured, you're not being ignore, we're just stretched thin!

@orbeckst orbeckst changed the title Conversion functions for Converter for OpenMM Aug 25, 2020
@orbeckst
Copy link
Member

orbeckst commented Sep 1, 2020

@ahy3nz if you need some additional eyes or have questions, feel free to ping; @IAlibay @lilyminium (and possibly others) were also interested in OpenMM integration.

@ahy3nz
Copy link
Contributor Author

ahy3nz commented Mar 14, 2021

@lilyminium @IAlibay @orbeckst @jbarnoud Please let me know what else needs to be done. Otherwise, if this is currently an undesired feature/approach, I can go ahead and close this PR

@IAlibay
Copy link
Member

IAlibay commented Mar 14, 2021

@ahy3nz this is definitely still a very much desired feature.

I'm so sorry about the delay here, the main issue we're facing is that we have a crazy large queue of fixes to do before we can even start concentrating on v2.0 stuff + lots of GSoC stuff to deal with :(

If one of the @MDAnalysis/coredevs has capacity to take over the review here that would be great!

I'll put it as a milestone for 2.0, so hopefully that'll get someone to finish up the review ASAP.

@IAlibay IAlibay added this to the 2.0 milestone Mar 14, 2021
@IAlibay IAlibay requested review from jbarnoud and lilyminium April 22, 2021 18:21
Copy link
Member

@lilyminium lilyminium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ahy3nz and so sorry for the long delay. I'm not super familiar with OpenMM so I have some questions about units and the PDB angle parsing.

.disabled-travis.yml Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/OpenMM.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/OpenMM.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/OpenMM.py Outdated Show resolved Hide resolved
testsuite/MDAnalysisTests/coordinates/test_openmm.py Outdated Show resolved Hide resolved
@lilyminium
Copy link
Member

Also if you could fix the merge conflicts and PEP8 as noted by the bot (#2917 (comment)), that'd be great.

@jbarnoud
Copy link
Contributor

jbarnoud commented May 5, 2021

I am looking at this PR now. I tested it on my use case and it worked neatly! I still need to understand why codecov reports numbers so low for the test coverage while I do see quite a lot of tests. I will also check how the doc looks and fix for PEP8 where relevant.

jbarnoud added 2 commits May 5, 2021 11:58
* Add the stubs to trigger the build and link to the documentation of
  the new modules
* Fix issues with references in the docstrings
@jbarnoud
Copy link
Contributor

jbarnoud commented May 5, 2021

The low coverage was because of the restrictions github recently added to the CI. I allowed the workflows to run and the patch coverage is 98.43%.

The docstrings do not appear in the documentation and the linter still complains about some PEP8 errors. Instead of asking @ahy3nz to grind through a bunch of tiny trivial fixes, I opened a PR against their branch: ahy3nz#1

With these small fixes, the PR looks good to go for me.

@jbarnoud
Copy link
Contributor

jbarnoud commented May 5, 2021

Note that it would be very cool to have this merged in for version 2.0. The feature freeze for that version is on Friday so it would be great if you could merge my changes by then. Sorry to rush you after I made you wait for basically ever, but the feature really is great!

Small changes to the OpenMM pull request
@IAlibay
Copy link
Member

IAlibay commented May 5, 2021

@ahy3nz this is your first PR for MDAnalysis right? Please don't forget to add yourself to AUTHORS and update the CHANGELOG too! 🎉

edit: ignore me, for some reason my github view didn't include all the files.

Copy link
Contributor

@jbarnoud jbarnoud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super acquainted with the inner workings of OpenMM, but lgtm

@jbarnoud jbarnoud dismissed lilyminium’s stale review May 5, 2021 17:12

All the comments are addressed, so I dismiss the review with @lilyminium approval.

@jbarnoud jbarnoud merged commit 7f2ce3d into MDAnalysis:develop May 5, 2021
@jbarnoud
Copy link
Contributor

jbarnoud commented May 5, 2021

Congratulations on your first contribution @ahy3nz! It as a substantial one and I am very glad it is in. I am very sorry it took so long.

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

Successfully merging this pull request may close these issues.

Interoperability with OpenMM
9 participants