Skip to content
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

ESM3 Protein fold example #1012

Merged
merged 30 commits into from
Dec 17, 2024
Merged

ESM3 Protein fold example #1012

merged 30 commits into from
Dec 17, 2024

Conversation

shariqm-modal
Copy link
Collaborator

Fold Proteins using ESM3 and visualize confidence in structure and known structures from PDBs

Screenshot 2024-12-04 at 1 46 47 PM

Type of Change

  • New example
  • Example updates (Bug fixes, new features, etc.)
  • Other (changes to the codebase, but not to examples)

Checklist

  • Example is testable in synthetic monitoring system, or lambda-test: false is added to example frontmatter (---)
    • Example is tested by executing with modal run or an alternative cmd is provided in the example frontmatter (e.g. cmd: ["modal", "deploy"])
    • Example is tested by running with no arguments or the args are provided in the example frontmatter (e.g. args: ["--prompt", "Formula for room temperature superconductor:"]
  • Example is documented with comments throughout, in a Literate Programming style.
  • Example does not require third-party dependencies to be installed locally
  • Example pins its dependencies
    • Example pins container images to a stable tag, not a dynamic tag like latest
    • Example specifies a python_version for the base image, if it is used
    • Example pins all dependencies to at least minor version, ~=x.y.z or ==x.y
    • Example dependencies with version < 1 are pinned to patch version, ==0.y.z

Outside contributors

You're great! Thanks for your contribution.

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-2fce074.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-49a1375.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-3b50946.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-ffeec26.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-e0f2cb8.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-be2e81c.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-4cde486.modal.run

06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Outdated Show resolved Hide resolved
06_gpu_and_ml/protein-folding/esm3.py Show resolved Hide resolved
@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-3357c03.modal.run

@shariqm-modal
Copy link
Collaborator Author

shariqm-modal commented Dec 12, 2024

Summary of updates:

  • Plugged in molstar and removed py3Dmol and my wrapper around it
  • Replaced PDB id with UniProt Accession Numbers which is more modern and contains links to more databases
  • Use a FASTA database to read sequence data more clean
  • Return mmCIF bytes instead of an ESMProtein for the inference class, use gemmi for PDB->mmCIFF conversion
  • Store model weights on volume using HF_HOME

Punts (b/c taking too long):

  • Not plotting secondary structure of ESM Output
  • Not plotting pLDDT confidence of ESM Output
  • Not plotting PDB structure of known properties

gradio_ui

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-b258ecd.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-7610d86.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-daf4d60.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-592a10d.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-ee736f3.modal.run

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-4098d6a.modal.run

Copy link
Collaborator

@charlesfrye charlesfrye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note about structure, on top of the changes I made.


# To minimize cold start times we'll store the ESM3 model weights on a Modal
# [Volume](https://modal.com/docs/guide/volumes). Normally we would do that
# through the `cache_dir` argument of `from_pretrained` but ESM3 doesn't
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too early to introduce this statement -- there's no use of from_pretrained here, we're just setting up paths and Volumes.

When writing documenation, you want to minimize the load on the user's working memory -- a bit like utilizing a hardware-managed cache, where you want temporal locality.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my updates, I added a link to the model weights guide -- that way we can defer discussion of finer points.

@charlesfrye
Copy link
Collaborator

🚀 The docs preview is ready! Check it out here: https://modal-labs-examples--frontend-preview-fc30e47.modal.run

@charlesfrye charlesfrye merged commit 8720c8e into main Dec 17, 2024
7 checks passed
@charlesfrye charlesfrye deleted the protein_fold_example branch December 17, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants