Support job-scoped custom CCD definitions for PTM inference#314
Open
taivu1998 wants to merge 1 commit into
Open
Support job-scoped custom CCD definitions for PTM inference#314taivu1998 wants to merge 1 commit into
taivu1998 wants to merge 1 commit into
Conversation
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.
Summary
Adds job-scoped custom CCD support for inference so users can provide custom PTM or ligand chemical components directly in the input JSON instead of editing the global Protenix CCD cache files.
This PR addresses #245.
Motivation
Issue #245 asks whether a user-generated PTM can be added to a specified residue at model input time. The existing workaround required mutating the shared CCD cache files, which is awkward for one-off inference jobs, hard to isolate between jobs, and easy to misconfigure.
Changes
CCDProvideroverlay that can load custom components from either:userCCD: inline CCD mmCIF textuserCCDPath: a CCD mmCIF file path, resolved relative to the input JSON fileptmType: "CCD_<code>".userCCDanduserCCDPathare preserved in generated inference JSON.examples/.Validation
.venv-test/bin/python -m pytest tests/test_user_ccd_ptm.py -q7 passed.venv-test/bin/python -m py_compile protenix/data/core/custom_ccd.py protenix/data/core/ccd.py protenix/data/core/parser.py protenix/data/inference/infer_dataloader.py protenix/data/inference/json_parser.py protenix/data/inference/json_to_feature.py protenix/web_service/colab_request_parser.py tests/test_user_ccd_ptm.pyuvx ruff check --select E9,F63,F7,F82 protenix/data/core/custom_ccd.py protenix/data/core/ccd.py protenix/data/core/parser.py protenix/data/inference/infer_dataloader.py protenix/data/inference/json_parser.py protenix/data/inference/json_to_feature.py protenix/web_service/colab_request_parser.py tests/test_user_ccd_ptm.pyuvx ruff check --select F401,F821,E9 protenix/data/core/custom_ccd.py protenix/data/core/ccd.py protenix/data/core/parser.py protenix/data/inference/infer_dataloader.py protenix/data/inference/json_parser.py protenix/data/inference/json_to_feature.py protenix/web_service/colab_request_parser.py tests/test_user_ccd_ptm.pygit diff --check