Added pip install option, added model wrapper class #143
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.
Hello! This branch is an implementation that I built for a project I'm working on. I've found it really helpful for programmatic use, and thought it might be a nice addition to the codebase. I tried to make very minimal changes to the core implementation. Happy to clean this up or make changes based on feedback!
Additions
The primary addition is a wrapper class (in
protein_mpnn.py) which provides a stateful API that separates model initialization from inference:Example usage:
I also added the option to pip install the package, which automatically downloads the weights to the correct folders so users can import the wrapper class without needing to clone.
Modifications
The only change to the original source code is to
protein_mpnn_utils.py, where I modified parse_PDB() to accept PDB content strings in addition to file paths (backward compatible)Tests
Added some tests to ensure that the pip installation works, and added a CI workflow test to ensure changes people push to the repo do not break this behavior