Skip to main content

PymolFold

Inspired by ColabFold by Sergey O.
Visualization inspired by pymol-color-alphafold.
Thanks to ESMFold by Meta and the API.
Fast access to AlphaMissense predicted Human proteins provided by hegelab.

Quick Start Guide

Step 1: Install PyMOL

PymolFold runs as a plugin within PyMOL. First, ensure you have PyMOL installed. Visit the official PyMOL website to download and install the appropriate version for your operating system.


Step 2: Install the Plugin

There are two ways to install PymolFold in PyMOL:

Method 1: Using the Plugin Manager(Recommended)

  1. Open PyMOL.

  2. Navigate to Plugin -> Plugin Manager.

  3. Select the Install New Plugin tab.

  4. In the URL field, enter:

    https://raw.githubusercontent.com/JinyuanSun/PymolFold/refs/heads/main/run_plugin.py
    
  5. Click Fetch. A command prompt window will appear, showing the progress of the installation.

  6. Add it to startup if you want PymolFold to load automatically when PyMOL starts.

  7. Once you choose to add to startup, it will also automatically update to the latest version when you start PyMOL in the future.

Method 2: Using the run Command

  1. Open PyMOL.

  2. In the PyMOL command line (starting with PyMOL>), copy and paste the following command, then press Enter:

    run https://raw.githubusercontent.com/JinyuanSun/PymolFold/refs/heads/main/run_plugin.py
    
  3. Wait patiently as PyMOL downloads and installs the PymolFold plugin.

NOTE: Both methods will take 4-5 minutes(depending on your internet speed) to complete. After installation, you will see a success message in the PyMOL dialog box.

If you already have the latest version installed, you will see the following message:

Troubleshooting Installation on Windows

If you encounter the following error during installation:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

This error is likely due to an outdated software version on your computer. To resolve this:

  1. Visit Microsoft Visual C++ Build Tools.
  2. Download and install the build tools by running the provided .exe file.
  3. Refer to this StackOverflow guide for additional help.
  4. After installation, retry the plugin installation process.

Step 3: Set API Keys

PymolFold relies on the ESM3 and NVIDIA Boltz-2 APIs. Obtain free API keys from their respective websites:

  1. ESM3 API Key:

    • Visit ESM3 API.
    • Register and log in to find your API key on the account page.
  2. NVIDIA Boltz-2 API Key:

    • Visit NVIDIA Boltz-2 API.
    • Register and log in to find your API key on the integration page.
  3. NO API KEY is needed for ESMFold (yeaah!), but 400 residues limit applies(noooo!).

  4. Set API Keys in PyMOL:

    Use the set_api_key command in PyMOL to configure your keys. Replace your_..._key with your actual keys:

    ## Set ESM3 API Key
    PyMOL> set_api_key ESM_API_TOKEN, your_esm_api_key
    
    ## Set NVIDIA Boltz-2 API Key
    PyMOL> set_api_key NVCF_API_KEY, your_nvcf_api_key
    

    Verify API Key Setup:

    PyMOL> import os
    PyMOL> print(os.environ.get("ESM_API_TOKEN"))
    PyMOL> print(os.environ.get("NVCF_API_KEY"))
    

    If the keys are printed successfully, the setup is complete.


Feature Overview

PymolFold offers powerful features for protein structure prediction and analysis:

1. Predict Monomer Structures (esm3, esmfold, bfold)

  • esm3: Predicts monomer structures using the ESMFold engine.
  • esmfold: CLI version of ESMFold for monomer predictions.
  • bfold: Simplified CLI for Boltz-2, automatically fetching MSA for monomers.

Usage:

esm3 sequence [, name]
## Example:
esm3 MKTVRQERLKSIVRILERSKEPVSGAQLAEELSVSRQVIVQDIAYLRSLGYNIVATPRGYVLAGG, my_protein

2. Folding Web Interface (foldingui)

Run foldingui to open a web interface in your default browser. This interface supports:

  • ESMFold: Visual version of the CLI.
  • ESM3: Visual version of the CLI.
  • Boltz-2: Advanced version of bfold, supporting proteins, DNA, RNA, and small molecules.

Examples (Boltz-2):

You can run the provided example:

When using CCD code, you can check all the existed CCDs under pymolfold/gui/ccd_keys.json. And all the codes are from RCSB CCD database.

MORE DETAILED FEATURES:

  1. If you want to predict a head-tail amide bonded cyclic peptide, you may set cyclic on.

  2. If you want to use MSA as an auxiliary information, you may set Add MSA on. It will automatically query colab design msa search via NVIDIA API.

  3. Calculate affinity when at least one sequence and one small molecule are present.

  4. Upon 3 modifications can be added to residues:

    The CCD codes also can be found under pymolfold/gui/ccd_keys.json.

  5. After clicking Run on the web page, wait about 6 seconds (depending on protein size), and the structure will appear in PyMOL!

3. Color by pLDDT Scores (color_plddt)

Color structures based on pLDDT scores to visualize prediction confidence.

Usage:

color_plddt object_name
## Example:
color_plddt my_protein

4. Evaluate Predictions (pxmeter_align)

We utilized PXMeter to evaluate the differences between predicted structures and reference structures. PXMeter(0.1.4) now only supports PPI analysis, and more details can be seen in their repo. But unfortunately, we copied the repo and refine it since the python version may conflict with the one of PyMOL.

Currently, only .cif files are supported for alignment.

Usage:

pxmeter_align obj_real_structure_name, obj_pred_structure_name

Note: The first use may take longer as it downloads a CCD component .cif file for non-standard amino acid alignment.

After running the script above, you will get the metrics in csv and png format under the folder you setted (if not set, it will generate in the root path). You can use the exmaple files under pymolfold/example/, and the results should be exactly the same as pymolfold/example/metrics.


Related Paper

For more details about the methodology and implementation, please refer to our preprint:

"PymolFold: Integrating Protein Structure Prediction into PyMOL" on bioRxiv.


License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for pymolfold 0.2.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymolfold 0.2.13
File Size Uploaded Provenance
pymolfold-0.2.13.tar.gz 141.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pymolfold 0.2.13
File Interpreter ABI Platform
pymolfold-0.2.13-py3-none-any.whl Python 3 none any Details

Total release size: 276.6 kB

Release files / pymolfold-0.2.13.tar.gz

Download URL pymolfold-0.2.13.tar.gz
Size 141.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9f49cd11c2cfa027ba2e2806c245011eae23047a324d2062ba7013ccde62538b
BLAKE2b-256 checksum
How to use checksums
e95274de0c3535cb5f97a9e8ef3b62b1ca9dfbb046cad6fb078feb5022ab893c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release files / pymolfold-0.2.13-py3-none-any.whl

Download URL pymolfold-0.2.13-py3-none-any.whl
Size 134.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1b16b480084308149c7df597612686d6615395b7bff42bdbe004250072d93f4
BLAKE2b-256 checksum
How to use checksums
3e44ba27fb5e85b3a6a8ef9ba59dfcd01087c0d1d7fce8acaec77a2c5d4c1796
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Security for pymolfold 0.2.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page