fix(parser): parser exposes altloc argument#71
fix(parser): parser exposes altloc argument#71k-chrispens wants to merge 1 commit intoRosettaCommons:productionfrom
Conversation
Altlocs are now grabbed when in and
There was a problem hiding this comment.
Pull request overview
This PR exposes the altloc (alternate location indicator) argument to the parse function, enabling users to control how alternate conformations are handled during structure parsing. Previously, this option was only available in load_any, and parse was hardcoded to use "first" altloc filtering.
Key changes:
- Added
altlocparameter toparse()function with default value "first" to maintain backward compatibility - Implemented validation to prevent incompatible parameter combinations (altloc='all' with add_missing_atoms or fix_bond_types)
- Enhanced documentation for the
altlocparameter in bothparse()andload_any()functions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/atomworks/io/parser.py | Added altloc parameter to parse() function signature, docstring, validation logic, and propagated it through _parse_from_cif() and _parse_from_pdb() helper functions. Also includes a formatting improvement for an assert statement. |
| src/atomworks/io/utils/io_utils.py | Expanded documentation for the altloc parameter in load_any() to clarify the behavior of each option ("first", "occupancy", "all", or specific altloc ID). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…secondary-structure-annotation feat: Add DSSP secondary structure annotation
|
Question: is it possible to merge this? We are slightly dependent on this getting merged for some of our downstream work in sampleworks. I also did run the tests, which passed, so I'm not quite sure why the lint_and_test workflow failed. |
📋 PR Checklist
This PR is tagged as a draft if it is still under development and not ready for review.
I have ensured that all my commits follow angular commit message conventions.
I have run
make formaton the codebase before submitting the PR (this autoformats the code and lints it).I have named the PR in angular PR message format as well (c.f. above), with a sensible tag line that summarizes all the changes in the PR.
ℹ️ PR Description
What changes were made and why?
Exposed the altloc argument to parse, which will enable applying the same sort of altloc filtering with
parseas withload_any. This only works properly whenadd_missing_atoms=False, as the template matching to CCDs fails otherwise.How were the changes tested?
Additional Notes
Also added relevant docstrings!