{"id":22731036,"url":"https://github.com/genentech/ringer","last_synced_at":"2025-04-14T00:32:43.216Z","repository":{"id":171546435,"uuid":"644267588","full_name":"Genentech/ringer","owner":"Genentech","description":"RINGER: Rapid Conformer Generation for Macrocycles with Sequence-Conditioned Internal Coordinate Diffusion","archived":false,"fork":false,"pushed_at":"2024-08-13T18:06:25.000Z","size":120158,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-11-25T21:28:55.314Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Genentech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-23T07:05:23.000Z","updated_at":"2024-10-18T16:25:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"36375499-1376-4738-a5c6-edfa3477037b","html_url":"https://github.com/Genentech/ringer","commit_stats":null,"previous_names":["genentech/ringer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2Fringer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2Fringer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2Fringer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Genentech%2Fringer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Genentech","download_url":"https://codeload.github.com/Genentech/ringer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229117068,"owners_count":18022819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T19:19:12.027Z","updated_at":"2024-12-10T19:19:13.532Z","avatar_url":"https://github.com/Genentech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RINGER\n\nThis repository is the official implementation of [RINGER: Rapid Conformer Generation for Macrocycles with Sequence-Conditioned Internal Coordinate Diffusion](https://arxiv.org/abs/2305.19800).\n\n![cover](assets/overview.png)\n\n## Requirements\n\nTo install requirements:\n\n```setup\nconda env create -f environment.yaml\nconda activate ringer\npip install -e .\n```\n\n## Data\n\nDownload and extract the CREMP pickle.tar.gz from [here](https://doi.org/10.5281/zenodo.7931444). Use [train.csv](data/cremp/train.csv) and [test.csv](data/cremp/test.csv) to partition it into training and test data and put the corresponding files into [train](data/cremp/train) and [test](data/cremp/test).\n\n## Training\n\nTo train the full conditional model, run this command:\n\n```train\ntrain conditional.json\n```\n\nThe config file can be specified by an absolute path or by a path relative to the [configs](configs) folder. Similarly, within the config file, `data_dir` can be an absolute path or a path relative to the [data](data) folder.\n\nTo log a training run with Weights \u0026 Biases, set up your configuration in [configs/wandb/wandb.json](configs/wandb/wandb.json) and set up logging using:\n\n```train\ntrain conditional.json --wandb-run \u003crun_name\u003e\n```\n\n## Sampling\n\nThe [pre-trained model](assets/models/conditional) is included in this repository.\n\nTo generate samples for the CREMP test set, run:\n\n```eval\nevaluate \\\n    --model-dir assets/models/conditional \\\n    --data-dir cremp/test \\\n    --split-sizes 0.0 0.0 1.0 \\\n    --sample-only\n```\n\nThis creates a `sample` directory containing samples for all molecules in `sample/samples.pickle`.\n\nRun `evaluate --help` to see all options available for sampling and evaluation.\n\n## Reconstruction\n\nThe `evaluate` command can also be used to reconstruct backbones (not including side chains) and to compute evaluation metrics. However, it is not recommended to do so because `evaluate` does not parallelize well across molecules.\n\nInstead, reconstruction (including side chains) is done most effectively for each molecule individually using [scripts/reconstruct_single.py](scripts/reconstruct_single.py). Parallelization can then be efficiently achieved by submitting a batch job array using an HPC job scheduler (e.g., Slurm) and passing the job array index as the first argument to the script. To reconstruct molecule 0, run:\n\n```shell\npython scripts/reconstruct_single.py 0 \\\n    cremp/test \\\n    sample/samples.pickle \\\n    sample/reconstructed_mols \\\n    assets/models/conditional/training_mean_distances.json\n```\n\nThe script will run the optimization to reconstruct the ring coordinates, followed by a linear (NeRF) reconstruction of the side chains using the [conformer samples previously generated](#sampling), and save the resulting molecule in `sample/reconstructed_mols`. Note that even though we point the script to `cremp/test`, it only uses the atom identities and connectivity information from the test molecules; their geometries are entirely set during the reconstruction procedure.\n\nRun `python scripts/reconstruct_single.py --help` for an overview of other parameters available for reconstruction.\n\n## Evaluation\n\nAs with reconstruction, computing metrics is best done separately for each molecule using [scripts/compute_metrics_single.py](scripts/compute_metrics_single.py) followed by aggregation across molecules using [scripts/aggregate_metrics.py](scripts/aggregate_metrics.py). For example, to compute metrics for the `H.A.S.V` macrocycle, run\n\n```shell\npython scripts/compute_metrics_single.py \\\n    cremp/test/H.A.S.V.pickle \\\n    sample/reconstructed_mols/H.A.S.V.pickle\n```\n\nRun `python scripts/compute_metrics_single.py --help` and `python scripts/aggregate_metrics.py --help` for an overview of other parameters available for computing metrics.\n\n## Contributing\n\nInstall pre-commit hooks to use automated code formatting before committing changes. Make sure you're in the top-level directory and run:\n\n```bash\npre-commit install\n```\n\nAfter that, your code will be automatically reformatted on every new commit.\n\nTo manually reformat all files in the project, use:\n\n```bash\npre-commit run -a\n```\n\nTo update the hooks defined in [.pre-commit-config.yaml](.pre-commit-config.yaml), use:\n\n```bash\npre-commit autoupdate\n```\n\n## License\n\nLicensed under the MIT License. See [LICENSE](LICENSE) for additional details.\n\n## Citations\n\nFor the code and/or model, please cite:\n\n```\n@misc{grambow2023ringer,\n    title={{RINGER}: Rapid Conformer Generation for Macrocycles with Sequence-Conditioned Internal Coordinate Diffusion}, \n    author={Colin A. Grambow and Hayley Weir and Nathaniel L. Diamant and Alex M. Tseng and Tommaso Biancalani and Gabriele Scalia and Kangway V. Chuang},\n    year={2023},\n    eprint={2305.19800},\n    archivePrefix={arXiv},\n    primaryClass={q-bio.BM}\n}\n```\n\nTo cite the CREMP dataset, please use:\n\n```\n@article{grambow2024cremp,\n    title = {{CREMP: Conformer-rotamer ensembles of macrocyclic peptides for machine learning}},\n    author = {Grambow, Colin A. and Weir, Hayley and Cunningham, Christian N. and Biancalani, Tommaso and Chuang, Kangway V.},\n    year = {2024},\n    journal = {Scientific Data},\n    doi = {10.1038/s41597-024-03698-y},\n    pages = {859},\n    number = {1},\n    volume = {11}\n}\n```\n\nYou can also cite the CREMP Zenodo repository directly:\n\n```\n@dataset{grambow_colin_a_2023_7931444,\n  author       = {Grambow, Colin A. and\n                  Weir, Hayley and\n                  Cunningham, Christian N. and\n                  Biancalani, Tommaso and\n                  Chuang, Kangway V.},\n  title        = {{CREMP: Conformer-Rotamer Ensembles of Macrocyclic \n                   Peptides for Machine Learning}},\n  month        = may,\n  year         = 2023,\n  publisher    = {Zenodo},\n  version      = {1.0.1},\n  doi          = {10.5281/zenodo.7931444},\n  url          = {https://doi.org/10.5281/zenodo.7931444}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenentech%2Fringer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenentech%2Fringer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenentech%2Fringer/lists"}