fix(parser): parser exposes altloc argument#71
Open
k-chrispens wants to merge 1 commit intoRosettaCommons:productionfrom
Open
fix(parser): parser exposes altloc argument#71k-chrispens wants to merge 1 commit intoRosettaCommons:productionfrom
k-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.
partrita
pushed a commit
to partrita/atomworks
that referenced
this pull request
Jan 19, 2026
…secondary-structure-annotation feat: Add DSSP secondary structure annotation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 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!