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

TPR reader sets chainID from molblock #4281

Merged
merged 8 commits into from
Sep 14, 2023

Conversation

pgbarletta
Copy link
Contributor

@pgbarletta pgbarletta commented Sep 5, 2023

Fixes #3994

Trying to revive this issue, following @orbeckst's suggestion (don't set molblock to Segments, but to chainIDs). As usual, I'll delete the PR and the issue if this is not deemed useful.

Changes made in this Pull Request:

  • tpr_utils.do_mtop() sets the chainID of each atom as this: chainID = molblock[14:] if molblock[:14] == "Protein_chain_" else molblock
  • on the testing side: TPRAttrs adds chainIDs to the list expected_attrs. I didn't thought it was necessary to add more tests on top of that.

If approved I'll add 'chainID' here.

This does not warrant an addition to the versionchanged heading, right?

PR Checklist

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

Developers certificate of origin


📚 Documentation preview 📚: https://mdanalysis--4281.org.readthedocs.build/en/4281/

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Linter Bot Results:

Hi @pgbarletta! Thanks for making this PR. We linted your code and found the following:

Some issues were found with the formatting of your code.

Code Location Outcome
main package ⚠️ Possible failure
testsuite ✅ Passed

Please have a look at the darker-main-code and darker-test-code steps here for more details: https://github.com/MDAnalysis/mdanalysis/actions/runs/6190054151/job/16805470720


Please note: The black linter is purely informational, you can safely ignore these outcomes if there are no flake8 failures!

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

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

I am in favor of your change, @pgbarletta.

Do the tests check that specific chainIDs were parsed?

Please also do the usual (update CHANGELOG, docs, ...). Ping me when you need me to review again.

@orbeckst orbeckst self-assigned this Sep 5, 2023
@codecov
Copy link

codecov bot commented Sep 5, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (16647cb) 93.40% compared to head (ea0a06f) 93.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop    #4281     +/-   ##
==========================================
  Coverage    93.40%   93.40%             
==========================================
  Files          170      184     +14     
  Lines        22250    23363   +1113     
  Branches      4071     4071             
==========================================
+ Hits         20783    21823   +1040     
- Misses         951     1024     +73     
  Partials       516      516             
Files Changed Coverage Δ
package/MDAnalysis/topology/TPRParser.py 90.16% <ø> (ø)
package/MDAnalysis/topology/tpr/utils.py 95.52% <100.00%> (+0.04%) ⬆️

... and 14 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pgbarletta
Copy link
Contributor Author

I added the expected chainIDs to TestTPRGromacsVersions ---which inherits from TPRAttrs---, and then added the test_chainIDs() function to TPRAttrs. Let me know if I interpreted the testing style correctly or not.

@pgbarletta pgbarletta requested a review from orbeckst September 5, 2023 17:01
Copy link
Member

@orbeckst orbeckst 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. I think the testing is doing the right thing. It's a bit complicated and it took me a while to see what's happening with all the inheritance. The fact that you're testing a case with two chains gives me some confidence that it works.

Sorry for the delay, I had thought I had already done this review but obviously not... in general, feel free to ping me when a week has passed!

- issue number for PR
- cleanup of other CHANGELOG entries
@orbeckst orbeckst merged commit 2197a2c into MDAnalysis:develop Sep 14, 2023
@orbeckst
Copy link
Member

Thanks @pgbarletta !

@orbeckst
Copy link
Member

This does not warrant an addition to the versionchanged heading, right?

I read through everything an decided at the very last minute that it was better to document what we are doing and added it.

@orbeckst
Copy link
Member

We do need to update the User Guide so I raised MDAnalysis/UserGuide#312 — could you please do that, @pgbarletta ? Thanks.

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.

Set chainID [was: segID] from molblock in TPR parser
3 participants