-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b4fcd93
Showing
51 changed files
with
208,594 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,189 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# poetry | ||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. | ||
# This is especially recommended for binary packages to ensure reproducibility, and is more | ||
# commonly ignored for libraries. | ||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control | ||
#poetry.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# PyCharm | ||
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can | ||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore | ||
# and can be added to the global gitignore or merged into this file. For a more nuclear | ||
# option (not recommended) you can uncomment the following to ignore the entire idea folder. | ||
#.idea/ | ||
|
||
*.out* | ||
src/models/evals_new/*.csv | ||
.vscode/settings.json | ||
.vscode/launch.json | ||
*.tar | ||
*test_preds.csv | ||
*.npz | ||
*.tar.gz | ||
evals_new_gp_ky.zip | ||
data/*/splits/*.csv | ||
protein-uq_lambda*.yml | ||
src/models/test_results | ||
data/aav/splits/ | ||
data/gb1/splits/ | ||
data/meltome/splits/ | ||
flip_nobuilds_fromhistory_supercloud.yml | ||
src/models/archive_results/ | ||
src/models/results/*/ | ||
src/models/results/*_results.csv | ||
src/active_learning/**/explorative_greedy_step_*.csv | ||
src/active_learning/**/explorative_sample_step_*.csv | ||
src/active_learning/**/preds.csv | ||
src/active_learning/**/2022*.csv | ||
*.pickle | ||
*.png | ||
*.gif | ||
src/active_learning/LLMapReduce | ||
src/active_learning/LLMapReduce.zip | ||
src/models/svi_test.py | ||
src/*/archive_*/ | ||
src/*/LLSUB.*/ | ||
src/*/MAPRED.*/ | ||
src/active_learning/al_results/*/ | ||
*.bak | ||
environment_add_maybe.txt |
This file contains 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,9 @@ | ||
# Microsoft Open Source Code of Conduct | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
|
||
Resources: | ||
|
||
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) | ||
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) | ||
- Contact [[email protected]](mailto:[email protected]) with questions or concerns |
This file contains 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,11 @@ | ||
This project welcomes contributions and suggestions. Most contributions require you to agree to a | ||
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us | ||
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. | ||
|
||
When you submit a pull request, a CLA bot will automatically determine whether you need to provide | ||
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions | ||
provided by the bot. You will only need to do this once across all repos using our CLA. | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||
contact [[email protected]](mailto:[email protected]) with any additional questions or comments. |
This file contains 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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Microsoft Corporation. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE |
This file contains 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,85 @@ | ||
# Protein UQ | ||
[//]: # (Badges) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
<!-- [![DOI](https://zenodo.org/badge/x.svg)](https://zenodo.org/badge/latestdoi/x) --> | ||
|
||
Benchmark for uncertainty quantification (UQ) in protein engineering. | ||
|
||
## Citation | ||
If you use this code, please cite the following manuscript: | ||
``` | ||
@article{protein-uq, | ||
title={Benchmarking Uncertainty Quantification for Protein Engineering}, | ||
author={Greenman, Kevin P. and Amini, Ava P. and Yang, Kevin K.}, | ||
journal={TBD}, | ||
doi={TBD}, | ||
year={2023} | ||
} | ||
``` | ||
|
||
## Reproducing Results from the Manuscript | ||
|
||
### Environment Installation | ||
1. Install [Anaconda or Miniconda](https://docs.conda.io/projects/continuumio-conda/en/latest/user-guide/install/index.html) if you have not yet done so. | ||
2. `conda install -c conda-forge mamba` (optional, but recommended, if you do not already have `mamba` installed) | ||
3. `git clone [email protected]:microsoft/protein-uq.git` | ||
4. `cd protein-uq` | ||
5. `mamba env create -f environment.yml` or `conda env create -f environment.yml` (`mamba` is recommended for faster installation) | ||
6. `conda activate protein-uq` | ||
|
||
### Prepare Data in protein-uq repo | ||
1. `cd data` | ||
2. `for d in {aav,gb1,meltome}; do (cd $d; unzip splits.zip); done` | ||
|
||
### Creating ESM Embeddings | ||
We used the [FLIP](https://github.com/J-SNACKKB/FLIP) repository to generate ESM embeddings for our models. The following commands can be used to reproduce the embeddings used in this work: | ||
|
||
0. `cd ..` (to leave the `protein-uq` directory) | ||
1. `git clone --recurse-submodules [email protected]:J-SNACKKB/FLIP.git` (`--recurse-submodules` is required to clone the ESM submodule of the FLIP repo) | ||
2. `cd splits` | ||
3. `for d in {aav,gb1,meltome}; do (cd $d; unzip splits.zip); done` | ||
4. `cd ../baselines` | ||
5. `wget https://dl.fbaipublicfiles.com/fair-esm/models/esm1b_t33_650M_UR50S.pt` (this file is 7.3 GB) | ||
6. `wget https://dl.fbaipublicfiles.com/fair-esm/regression/esm1b_t33_650M_UR50S-contact-regression.pt` | ||
6. `flip_esm_embedding_commands.sh` - This script contains the commands used to generate the ESM embeddings with train-val-test splits for the 8 tasks used in this work. These commands should be run from the `baselines/` directory of the FLIP repository, and the `protein-uq` conda env must be activated. Each command will take a while. | ||
|
||
The embeddings will be saved in the `FLIP/baselines/embeddings/` directory. Pre-computed embeddings for the AAV landscape can also be downloaded from [Zenodo](https://doi.org/10.5281/zenodo.6549368). | ||
|
||
### Training and Evaluating Models with Uncertainty Quantification | ||
All training and inference for our models was done on the [MIT SuperCloud](https://supercloud.mit.edu/). We used this cluster's [LLMapReduce](https://supercloud.mit.edu/submitting-jobs#llmapreduce) command to make the most efficient use of resources using the cluster's scheduler and run our jobs in parallel. Original commands (run from `src/models/`): | ||
``` | ||
LLMapReduce --mapper=mapper_ohe.sh --input=inputs_ohe.txt --output=output_ohe --gpuNameCount=volta:1 --np [4,2,20] --keep=True | ||
LLMapReduce --mapper=mapper_esm.sh --input=inputs_esm.txt --output=output_esm --gpuNameCount=volta:1 --np [4,2,20] --keep=True | ||
``` | ||
An equivalent list of commands in series is provided in `src/models/train_all_commands_series.sh`. | ||
|
||
### Active Learning | ||
All active learning for our models was done on the [MIT SuperCloud](https://supercloud.mit.edu/). We used this cluster's [LLMapReduce](https://supercloud.mit.edu/submitting-jobs#llmapreduce) command to make the most efficient use of resources using the cluster's scheduler and run our jobs in parallel. Scripts for running the jobs in series are also provided. Original command (run from `src/active_learning/`): | ||
``` | ||
LLMapReduce --mapper=mapper.sh --input=inputs.txt --output=output --gpuNameCount=volta:1 --np [4,2,20] --keep=True | ||
``` | ||
|
||
An equivalent list of commands in series is provided in `src/active_learning/active_learning_commands_series.sh`. | ||
|
||
### Plotting Results | ||
The following notebooks provided in the `notebooks/` directory can be used to reproduce the figures and tables in the manuscript: | ||
* `plot_results_1.ipynb`: Figures 2, 3, S1, S2, S4; Tables S1-S22 | ||
* `plot_results_2.ipynb`: Figures 4, S3 | ||
* `plot_results_active_learning.ipynb`: Figures 5, S5-S57 | ||
|
||
These notebooks require output files in the `src/models/results/` and `src/active_learning/al_results/` directories, which can be reproduced using the commands above. | ||
|
||
### Example Notebook | ||
The Jupyter notebook at `notebooks/example.ipynb` provides an example of how to train a model and make predictions with uncertainty quantification. | ||
|
||
## Support | ||
Open bug reports and ask questions on [GitHub issues](https://github.com/microsoft/protein-uq/issues). See [SUPPORT](https://github.com/microsoft/protein-uq/blob/main/SUPPORT.md) for details. | ||
|
||
## License | ||
This project is licensed under the terms of the MIT license. See [LICENSE](https://github.com/microsoft/protein-uq/blob/main/LICENSE) for additional details. | ||
|
||
## Contributing | ||
See [CONTRIBUTING](https://github.com/microsoft/protein-uq/blob/main/CONTRIBUTING.md). | ||
|
||
## Security | ||
See [SECURITY](https://github.com/microsoft/protein-uq/blob/main/SECURITY.md). |
This file contains 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,41 @@ | ||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK --> | ||
|
||
## Security | ||
|
||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). | ||
|
||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. | ||
|
||
## Reporting Security Issues | ||
|
||
**Please do not report security vulnerabilities through public GitHub issues.** | ||
|
||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). | ||
|
||
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). | ||
|
||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). | ||
|
||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: | ||
|
||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) | ||
* Full paths of source file(s) related to the manifestation of the issue | ||
* The location of the affected source code (tag/branch/commit or direct URL) | ||
* Any special configuration required to reproduce the issue | ||
* Step-by-step instructions to reproduce the issue | ||
* Proof-of-concept or exploit code (if possible) | ||
* Impact of the issue, including how an attacker might exploit the issue | ||
|
||
This information will help us triage your report more quickly. | ||
|
||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. | ||
|
||
## Preferred Languages | ||
|
||
We prefer all communications to be in English. | ||
|
||
## Policy | ||
|
||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). | ||
|
||
<!-- END MICROSOFT SECURITY.MD BLOCK --> |
This file contains 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,12 @@ | ||
# Support | ||
|
||
## How to file issues and get help | ||
|
||
This project uses GitHub Issues to track bugs and feature requests. Please search the existing | ||
issues before filing new issues to avoid duplicates. For new issues, file your bug or | ||
feature request as a new Issue. For help and questions about using this project, please | ||
also submit new Issues. | ||
|
||
## Microsoft Support Policy | ||
|
||
Support for this project is limited to the resources listed above. |
This file contains 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,7 @@ | ||
# Data | ||
|
||
## Datasets | ||
The data in this folder was copied from the [FLIP](https://github.com/J-SNACKKB/FLIP/tree/main/splits) repo. | ||
|
||
## Embeddings | ||
`embeddings/` is a symbolic link to the [embeddings](https://github.com/J-SNACKKB/FLIP/tree/main/baselines/embeddings) directory of FLIP. |
Oops, something went wrong.