-
Notifications
You must be signed in to change notification settings - Fork 11
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
Dihedral Plots: RDKit Mol Object #243
Conversation
cadeduckworth
commented
Feb 21, 2023
•
edited
Loading
edited
- add RDKit Mol object to dihedral analysis plots
- add tests, and close Add test to verify that dihedral analysis plots are labeled with the correct molecule and dihedral atom group #238
- close Fix import error in workflows base module (develop branch) #245
Codecov Report
@@ Coverage Diff @@
## develop #243 +/- ##
===========================================
+ Coverage 80.73% 81.12% +0.38%
===========================================
Files 15 15
Lines 1905 1960 +55
Branches 294 296 +2
===========================================
+ Hits 1538 1590 +52
- Misses 276 278 +2
- Partials 91 92 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…to atom_indices/get_atom_indices
@orbeckst Currently going back and looking at our previous conversations and the new links you sent to improve upon the existing methods.. |
That looks better. Very good. Did you check other examples, too? The other comments were along the lines
|
I checked the plots for that molecule that I have been testing on, but no others yet. I changed a lot of things that will be helpful moving forward, especially for testing. For each dihedral group in a molecule the EDIT (reminder): @orbeckst - relevant to discussion from our meeting on 6/29/23.. I did not remember because it was several months ago, but there was a method to the madness all along! |
|
To-Do:
|
This is where I have landed with the combined RDKIT/matplotlib to SVG composition. With the number of atoms in the SAMPL9 molecules, and the small text size of the atom indices, the SVG plots will look much better for those purposes. It should also maintain a consistent box size for all of the molecules, so the orientation or overall size of the molecule should not cause the image to zoom in or out like the Regarding the PDF output method, I figured out that, because the default size of the Regarding the SVG output method, the It might be best to use what I have developed for SVGs as an option that can be specified, for now, and use the pdf method as default, unless conda has something similar to inkscape that we can include as a dependency in order to facilitate viewing, conversion, and notebook embedding? |
The PDF looks sharp and can be zoomed in ✅ The next thing is to make sure that we don't need to scale it to out it into a paper. To make it publication-ready we would want it to be "at final size", i.e., typical two-column wide figure (about 190 mm, just randomly used https://writing.stackexchange.com/questions/21658/what-is-the-image-size-in-scientific-paper-if-indicated-as-a-single-1-5-or-2-c ) and font size should not be smaller than 9 pt. I think the matplotlib default is 10 so if you make figures at final size, everything should look good. |
Here are some plotting results after implementing existing method with
Example with a fairly cluttered molecule from SAMPL9 set (step=1000), before I added a little white space to the right border to allow for longer solvent names: SM25 & SM26 (testing resources) after increasing whitespace on right border: I have not been able to figure out how to suppress matplotlib output, which does not contain the Mol image. Moving forward I am working on fixing the tests to accommodate what was changed during development. After I achieve full coverage again I will request a review and start making changes to the documentation to reflect changes and new functionality. EDIT: see parentheses |
…s and altered function definitions
…s, remove broken test, add reminder to update func list in docs
The codecov report of 98.80% is misleading; some of my current tests are weak at best, and some are possibly not testing anything at all. Once the new SVG methods are finalized, more specific tests need to be written, existing tests need to be revisited, and fixture scopes need to be optimized. The 'plotting only one solvent issue' needs to be revisited (see most recent comments, SM25 & SM26 pdfs). The current method almost works, but results in an unnecessary solvent label in the legend. I have already already come up with a way to probably fix this but have not tested it yet. The plots look nice, they seem scalable (a few examples showed signs of adequate scaling, see also most recent comment for S07, SM255, SM26), and I am pleased with the combination of EDIT: As a forewarning the changed files here are littered with comments and bad practices, so I will try to clean those up before you get a chance to review. This one required changes on more levels, so PR229 and PR242 are more complete and take precedence. |
@orbeckst EDIT: Maybe it is best to default to using the topology and trajectory from the first solvent specified? |
It supports single solvent solvation free calculations, yes. You're right, the water directory does not necessarily exist. However, just raise an issue that we improve Let's not use the ITP file because that might not be present, e.g., when someone else ran just the FEP on a cluster. |
Actually, your idea to use the first solvent seems pretty good and easy enough to implement. You could even make |
ITP file? |
|
||
assert 'all analyses completed' in caplog.text, ('automated_dihedral_analysis ' | ||
'did not iteratively run to completion for the provided project') | ||
assert 'all analyses completed' in caplog.text, ('automated_dihedral_analysis ' |
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.
Unindent — that's better outside the pytest.raises block.
As a general rule reduce the amount of code in a with block to the essentials as this makes clearer what's relevant for testing the condition.
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 believe the test fails without the indent, possibly because of what is being tested or how it is written in the module. I am not certain of this, but making the change last night resulted in a passing test.
I was thinking along what I used for the dihedral sampler: use the initial files in the top level directories, including the topology file, but on second thought it makes no sense ebcause that files does not contain the solvent and is not useful for using with the trajectory. The TPR is really what we want. Sorry to have confused you. |
Docs say EDIT: I think |
@orbeckst Ready for review, all requested changes resolved or responded to. I raised several new issues and commented or updated some existing issues to document what needs to be done soon, but is not immediately necessary for merging this PR. Minor reviewing left to do on my part tomorrow as a sanity check, but I hope to get this merged and resubmit the SAMPL9 jobs Monday afternoon. |
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.
Only one code compactifitransmogration.
A momentous occasion: PR #243 has been merged. 🚀 🌟 Congratulations! |