pymolfold


Namepymolfold JSON
Version 0.2.10 PyPI version JSON
download
home_pagehttps://github.com/JinyuanSun/PymolFold
SummaryProtein structure prediction in PyMOL
upload_time2025-10-15 08:22:32
maintainerNone
docs_urlNone
authorJinyuan Sun, Yifan Deng
requires_python>=3.8
licenseMIT License Copyright (c) 2022 jinyuan sun & yifan deng 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.
keywords protein structure prediction pymol bioinformatics protein folding
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PymolFold
Inspired by [ColabFold](https://github.com/sokrypton/ColabFold) by [Sergey O](https://github.com/sokrypton).  
Visualization inspired by [pymol-color-alphafold](https://github.com/cbalbin-bio/pymol-color-alphafold).  
Thanks to ESMFold by Meta and the [API](https://esmatlas.com/about#api).  
Fast access to AlphaMissense predicted Human proteins provided by [hegelab](https://alphamissense.hegelab.org/).

## Quick Start Guide

### 1. Install PyMOL

This project enables structure and domain prediction directly within the PyMOL visualization software.  

SO, download and install PyMOL from the [official website](https://pymol.org/).

---

### 2. Run the Plugin

You can directly run the following command in >PyMOL

```bash
run https://raw.githubusercontent.com/JinyuanSun/PymolFold/refs/heads/main/run_plugin.py
```

If you see the following, installation was successful:  
<img src="./img/install.png" width="300">

---

### 3. Obtain API Tokens

PymolFold utilizes APIs from ESM3 and NVIDIA Boltz2.  
You need to obtain API tokens from both:

- [ESM3 API](https://forge.evolutionaryscale.ai)
- [NVIDIA Boltz2](https://build.nvidia.com/mit/boltz2?hosted_api=true&integrate_nim=true&modal=integrate-nim)

After obtaining your tokens, set them as environment variables:  
- `ESM_API_TOKEN`  
- `NVCF_API_KEY`  
Both must be **uppercase** and contain underscores.

**How to set environment variables:**
Again, in >PyMOL, you can execute following command step by step
```python
import os
print(os.environ["ESM_API_TOKEN"])
print(os.environ["NVCF_API_KEY"]) # if error occurs, it means you haven't set the key right

set_api_key ESM_API_TOKEN [, your_esm_api_key]
set_api_key NVCF_API_KEY [, your_nvcf_api_key]

print(os.environ["ESM_API_TOKEN"]) # it should print out what you just set
print(os.environ["NVCF_API_KEY"])
```

---

### 4. How to Use

PymolFold provides several features: `esm3`, `boltz2`, `color_plddt` and `pxmeter_align`.

#### 1. Predict Monomer Protein Structure

Use the convenient `esm3` command:

```python
esm3 sequence [, name]
# Example:
esm3 MKTVRQERLKSIVRILERSKEPVSGAQLAEELSVSRQVIVQDIAYLRSLGYNIVATPRGYVLAGG
```
<img src="./img/esmfold.png" width="400">

---

#### 2. Predict Complexes, DNA, RNA, or Ligand Structures

For more complex predictions, use the `boltz2` command.  
Due to the number of required inputs, a web interface is provided (inspired by [NVIDIA Boltz2](https://build.nvidia.com/mit/boltz2)).  
Currently, conditional prediction is not supported, but may be added in the future.

To launch the web interface, enter the following in the PyMOL command line:

```python
boltz2
```

You can run the provided example:  
<img src="./img/boltzexample.png" width="500">

When using CCD code, you can check all the existed CCDs under `pymolfold/gui/ccd_keys.json`.

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

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.

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

---

#### 3. View pLDDT Scores

After prediction, enter the following to view pLDDT scores for the predicted structure:

```python
color_plddt
```

#### 4. How to evaluate the predicted results?
We utilized [PXMeter](https://github.com/bytedance/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.

But how to use in PyMolFold?
```python
pxmeter_align obj_real_structure_name, obj_pred_structure_name
```
It takes around 20s to loading when you first time using this method.

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`.

<img src="./img/pxmeter.png" width="400">

## Others
**Version**
Current version is 0.2.10, and if you are interesting in the source code, you can install pymolfold directly by `pip install pymolfold==0.2.10`.

**Info**  
The PymolFold service is running on a A5000 instance (cost $100 a week), and the sequence length is limited to 1000aa.

**Issues and Errors**  
If you encounter any errors or issues while using this project, please don't hesitate to open an issue here on GitHub. Your feedback helps us improve the project and make it more user-friendly for everyone.

**PymolFold Server: A Shared Resource**  
Please note that the PymolFold server is a shared resource, and I request you to use it responsibly. Do not abuse the server, as it can affect the availability and performance of the service for other users.

```git
21Sept2025: Refactor PyMOLFold, deleting unrelated module, adding boltz2 using NVIDIA API
17Jan2025: Add `esm3` to use ESM-3 for folding.
21Aug2023: As the ESMFold API is not stable, the job will be sent to PymolFold server if the job failed.
11Apr2023: `pf_plugin.py` is the PyMOL plugin and the `pf_pkg.py` is a pymol-free python package.
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/JinyuanSun/PymolFold",
    "name": "pymolfold",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "protein, structure prediction, PyMOL, bioinformatics, protein folding",
    "author": "Jinyuan Sun, Yifan Deng",
    "author_email": "Jinyuan Sun <jinyuansun98@gmail.com>, Yifan Deng <dengyifan15@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/fb/02/0283b952ce9cf2270e163564d943c6f1ff4e397ae3c0124a6594b0984e5f/pymolfold-0.2.10.tar.gz",
    "platform": null,
    "description": "# PymolFold\nInspired by [ColabFold](https://github.com/sokrypton/ColabFold) by [Sergey O](https://github.com/sokrypton).  \nVisualization inspired by [pymol-color-alphafold](https://github.com/cbalbin-bio/pymol-color-alphafold).  \nThanks to ESMFold by Meta and the [API](https://esmatlas.com/about#api).  \nFast access to AlphaMissense predicted Human proteins provided by [hegelab](https://alphamissense.hegelab.org/).\n\n## Quick Start Guide\n\n### 1. Install PyMOL\n\nThis project enables structure and domain prediction directly within the PyMOL visualization software.  \n\nSO, download and install PyMOL from the [official website](https://pymol.org/).\n\n---\n\n### 2. Run the Plugin\n\nYou can directly run the following command in >PyMOL\n\n```bash\nrun https://raw.githubusercontent.com/JinyuanSun/PymolFold/refs/heads/main/run_plugin.py\n```\n\nIf you see the following, installation was successful:  \n<img src=\"./img/install.png\" width=\"300\">\n\n---\n\n### 3. Obtain API Tokens\n\nPymolFold utilizes APIs from ESM3 and NVIDIA Boltz2.  \nYou need to obtain API tokens from both:\n\n- [ESM3 API](https://forge.evolutionaryscale.ai)\n- [NVIDIA Boltz2](https://build.nvidia.com/mit/boltz2?hosted_api=true&integrate_nim=true&modal=integrate-nim)\n\nAfter obtaining your tokens, set them as environment variables:  \n- `ESM_API_TOKEN`  \n- `NVCF_API_KEY`  \nBoth must be **uppercase** and contain underscores.\n\n**How to set environment variables:**\nAgain, in >PyMOL, you can execute following command step by step\n```python\nimport os\nprint(os.environ[\"ESM_API_TOKEN\"])\nprint(os.environ[\"NVCF_API_KEY\"]) # if error occurs, it means you haven't set the key right\n\nset_api_key ESM_API_TOKEN [, your_esm_api_key]\nset_api_key NVCF_API_KEY [, your_nvcf_api_key]\n\nprint(os.environ[\"ESM_API_TOKEN\"]) # it should print out what you just set\nprint(os.environ[\"NVCF_API_KEY\"])\n```\n\n---\n\n### 4. How to Use\n\nPymolFold provides several features: `esm3`, `boltz2`, `color_plddt` and `pxmeter_align`.\n\n#### 1. Predict Monomer Protein Structure\n\nUse the convenient `esm3` command:\n\n```python\nesm3 sequence [, name]\n# Example:\nesm3 MKTVRQERLKSIVRILERSKEPVSGAQLAEELSVSRQVIVQDIAYLRSLGYNIVATPRGYVLAGG\n```\n<img src=\"./img/esmfold.png\" width=\"400\">\n\n---\n\n#### 2. Predict Complexes, DNA, RNA, or Ligand Structures\n\nFor more complex predictions, use the `boltz2` command.  \nDue to the number of required inputs, a web interface is provided (inspired by [NVIDIA Boltz2](https://build.nvidia.com/mit/boltz2)).  \nCurrently, conditional prediction is not supported, but may be added in the future.\n\nTo launch the web interface, enter the following in the PyMOL command line:\n\n```python\nboltz2\n```\n\nYou can run the provided example:  \n<img src=\"./img/boltzexample.png\" width=\"500\">\n\nWhen using CCD code, you can check all the existed CCDs under `pymolfold/gui/ccd_keys.json`.\n\nIf you want to predict a head-tail amide bonded cyclic peptide, you may set `cyclic` on.\n\nIf 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.\n\nAfter clicking **Run** on the web page, wait about 6 seconds (depending on protein size), and the structure will appear in PyMOL!\n\n---\n\n#### 3. View pLDDT Scores\n\nAfter prediction, enter the following to view pLDDT scores for the predicted structure:\n\n```python\ncolor_plddt\n```\n\n#### 4. How to evaluate the predicted results?\nWe utilized [PXMeter](https://github.com/bytedance/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.\n\nBut how to use in PyMolFold?\n```python\npxmeter_align obj_real_structure_name, obj_pred_structure_name\n```\nIt takes around 20s to loading when you first time using this method.\n\nAfter 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`.\n\n<img src=\"./img/pxmeter.png\" width=\"400\">\n\n## Others\n**Version**\nCurrent version is 0.2.10, and if you are interesting in the source code, you can install pymolfold directly by `pip install pymolfold==0.2.10`.\n\n**Info**  \nThe PymolFold service is running on a A5000 instance (cost $100 a week), and the sequence length is limited to 1000aa.\n\n**Issues and Errors**  \nIf you encounter any errors or issues while using this project, please don't hesitate to open an issue here on GitHub. Your feedback helps us improve the project and make it more user-friendly for everyone.\n\n**PymolFold Server: A Shared Resource**  \nPlease note that the PymolFold server is a shared resource, and I request you to use it responsibly. Do not abuse the server, as it can affect the availability and performance of the service for other users.\n\n```git\n21Sept2025: Refactor PyMOLFold, deleting unrelated module, adding boltz2 using NVIDIA API\n17Jan2025: Add `esm3` to use ESM-3 for folding.\n21Aug2023: As the ESMFold API is not stable, the job will be sent to PymolFold server if the job failed.\n11Apr2023: `pf_plugin.py` is the PyMOL plugin and the `pf_pkg.py` is a pymol-free python package.\n```\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2022 jinyuan sun & yifan deng\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Protein structure prediction in PyMOL",
    "version": "0.2.10",
    "project_urls": {
        "Documentation": "https://github.com/JinyuanSun/PymolFold#readme",
        "Homepage": "https://github.com/JinyuanSun/PymolFold",
        "Issues": "https://github.com/JinyuanSun/PymolFold/issues",
        "Repository": "https://github.com/JinyuanSun/PymolFold.git"
    },
    "split_keywords": [
        "protein",
        " structure prediction",
        " pymol",
        " bioinformatics",
        " protein folding"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b56262b214cfc0639606f160c8cb71707548f480d47515210c21992216cc9712",
                "md5": "80ebfafb57803c0c2baead8d0d7f8450",
                "sha256": "2e49041f2d3a6020d1d395fd1f826a167eeae6c2f8b250fe86656ae6f17a5dfa"
            },
            "downloads": -1,
            "filename": "pymolfold-0.2.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "80ebfafb57803c0c2baead8d0d7f8450",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 127391,
            "upload_time": "2025-10-15T08:22:31",
            "upload_time_iso_8601": "2025-10-15T08:22:31.167066Z",
            "url": "https://files.pythonhosted.org/packages/b5/62/62b214cfc0639606f160c8cb71707548f480d47515210c21992216cc9712/pymolfold-0.2.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fb020283b952ce9cf2270e163564d943c6f1ff4e397ae3c0124a6594b0984e5f",
                "md5": "4cedcda64d89c7a7af7b4902eec1f180",
                "sha256": "b9e15fc830de111f2cf664df211928dc11950bc3ff027e828713f0164d7791dc"
            },
            "downloads": -1,
            "filename": "pymolfold-0.2.10.tar.gz",
            "has_sig": false,
            "md5_digest": "4cedcda64d89c7a7af7b4902eec1f180",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 134402,
            "upload_time": "2025-10-15T08:22:32",
            "upload_time_iso_8601": "2025-10-15T08:22:32.898701Z",
            "url": "https://files.pythonhosted.org/packages/fb/02/0283b952ce9cf2270e163564d943c6f1ff4e397ae3c0124a6594b0984e5f/pymolfold-0.2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-15 08:22:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JinyuanSun",
    "github_project": "PymolFold",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pymolfold"
}
        
Elapsed time: 2.33839s