-
Notifications
You must be signed in to change notification settings - Fork 37
Feature/mmjson parser #67
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
Merged
nscorley
merged 6 commits into
RosettaCommons:production
from
N283T:feature/mmjson-parser
Dec 19, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d29653c
feat: Add example CIF/JSON data, update dependencies, and modify I/O …
N283T 88a7282
feat: Add mmjson file type support, update file type inference, and i…
N283T 2f0ea72
feat: add automated mmJSON parsing test and refactor buffer file type…
N283T b37aaf9
test: add 2hhb mmJSON and CIF test data and update test to use shared…
N283T 16e6a6f
style: apply ruff formatting and lint fixes
N283T 4941565
style: apply formatting fixes
N283T File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Binary file not shown.
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| from atomworks.io.parser import parse | ||
| from atomworks.io.utils.io_utils import infer_pdb_file_type | ||
| from atomworks.io.utils.testing import assert_same_atom_array | ||
| from tests.conftest import TEST_DATA_DIR | ||
|
|
||
|
|
||
| def test_mmjson_inference_and_parsing(): | ||
| json_path = TEST_DATA_DIR / "io" / "2hhb.json.gz" | ||
| cif_path = TEST_DATA_DIR / "io" / "2hhb.cif.gz" | ||
|
|
||
| assert json_path.exists(), f"mmJSON file not found at {json_path}" | ||
| assert cif_path.exists(), f"CIF file not found at {cif_path}" | ||
|
|
||
| # 1. Test File Type Inference | ||
| inferred_type = infer_pdb_file_type(json_path) | ||
| assert inferred_type == "mmjson", f"Failed to infer 'mmjson'. Got: {inferred_type}" | ||
|
|
||
| # 2. Parse mmJSON | ||
| result_json = parse(json_path, file_type="mmjson") | ||
| atoms_json = result_json["asym_unit"] | ||
|
|
||
| # 3. Parse CIF for Comparison | ||
| result_cif = parse(cif_path, file_type="cif") | ||
| atoms_cif = result_cif["asym_unit"] | ||
|
|
||
| # 4. Compare Results | ||
| # This utility checks atom count, coordinates, and other annotations | ||
| assert_same_atom_array(atoms_json, atoms_cif) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! |
||
Oops, something went wrong.
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.
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.
nice job!