Skip to content

Commit 50c10ca

Browse files
committed
Enhance AlphaFold3-GUI with improved input handling and covalent ligand workflows
- Updated README.md to clarify installation steps, features, and usage instructions. - Refactored streamlit_app.py to streamline entity input generation and validation. - Introduced helper functions for parsing JSON arrays and model seeds. - Enhanced ligand input handling with better covalent bond definition options. - Improved error handling in utils.py for RDKit operations and molecule manipulations. - Added validation checks for user inputs to ensure correct data entry.
1 parent 961f29c commit 50c10ca

3 files changed

Lines changed: 643 additions & 378 deletions

File tree

README.md

Lines changed: 97 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,107 @@
11
# AlphaFold3-GUI
22

3-
Welcome to the AlphaFold3-GUI repository! This project provides a user-friendly graphical user interface (GUI) for the generation of AlphaFold 3 input files, enabling researchers to easily set up, run, and analyze protein structure predictions without the need for extensive .json and .mmCIF editing.
4-
---
5-
## Installation
3+
`AlphaFold3-GUI` is a Streamlit app for building AlphaFold 3 input JSON files, including optional covalent ligand workflows from SMILES input.
4+
5+
It is designed for users who want a guided interface instead of manually editing JSON and mmCIF content.
6+
7+
## Features
8+
9+
- Build AlphaFold 3 input JSON for proteins, RNA, DNA, and ligands
10+
- Add multiple copies of entities with automatic label assignment (`A`, `B`, `C`, ...)
11+
- Enter polymer modifications/templates as JSON arrays
12+
- Generate covalent ligand `userCCD` content from a SMILES-derived ligand structure
13+
- Download the generated JSON directly from the UI
14+
15+
## Quick Start
616

717
### Prerequisites
18+
819
- Python 3.8+
9-
- Required Python packages (see `requirements.txt`)
10-
- AlphaFold 3 installed and configured on your system
11-
12-
### Steps
13-
1. Clone this repository:
14-
```bash
15-
git clone https://github.com/sieber-lab/AlphaFold3-GUI.git
16-
cd AlphaFold3-GUI
17-
```
18-
2. Install the dependencies:
19-
```bash
20-
pip install -r requirements.txt
21-
```
22-
3. Run the application:
23-
```bash
24-
streamlit run streamlit_app.py
25-
```
26-
27-
## Usage
28-
29-
### Step 1: Launch the GUI
30-
After running `streamlit run streamlit_app.py`, the AlphaFold3-GUI window will open. From here, you can generate your .json file.
31-
Alternatively, you can use the publicly accessible webserver: https://alphafold3-gui.streamlit.app/
32-
33-
### Step 2: Configure Input File
34-
1. Adjust prediction parameters such as proteins, and nucleic acids, ions, and ligands, similar to the AlphaFold3 Webserver.
35-
2. Unlike the AlphaFold3 Webserver, this interface supports covalent bond generation to any type of ligand, simply by SMILES input.
36-
3. Additionally, the interface supports editing of covalent ligands by:
37-
![AlphaFold3-GUI Screenshot](images/leaving_group_af.jpg)
38-
5. Selecting a leaving group via the 3D molecule visualization.
39-
6. Selecting the target atom using the 3D visualization.
40-
7. Use the built-in **JSON Generator** to create a JSON file that meets AlphaFold 3's input requirements.
41-
42-
### Step 4: Run Prediction
43-
1. Once the setup is complete, simply download the .json file, and use it as input for your AlphaFold3 prediction
20+
- AlphaFold 3 installed/configured separately (this repo only generates inputs)
21+
- Dependencies from `requirements.txt`
4422

45-
## License
23+
### Install
24+
25+
```bash
26+
git clone https://github.com/sieber-lab/AlphaFold3-GUI.git
27+
cd AlphaFold3-GUI
28+
pip install -r requirements.txt
29+
```
30+
31+
Notes:
32+
- `rdkit` installation can be platform-dependent. If `pip install` fails, install RDKit via `conda`/`mamba` and then install the remaining requirements.
33+
34+
### Run
35+
36+
```bash
37+
streamlit run streamlit_app.py
38+
```
39+
40+
## Usage Guide
41+
42+
### 1. Job Details
43+
44+
- Set a job name (used in the JSON and download filename)
45+
- Enter model seeds as comma-separated integers (invalid values are ignored with a warning)
46+
47+
### 2. Entity Counts
48+
49+
- Choose how many protein, RNA, DNA, and ligand entities to add
50+
- The app will create input sections for each entity
51+
52+
### 3. Fill Entity Inputs
4653

47-
This project is licensed under the Apache License. See the `LICENSE` file for details.
54+
- **Protein / RNA / DNA**: add sequences and optional modifications
55+
- **Ligand**: add a SMILES string or use the covalent workflow
4856

49-
## Acknowledgments
57+
### 4. Optional Covalent Ligand Workflow
58+
59+
The covalent workflow helps create a custom ligand and bond definition:
60+
61+
1. Render the ligand from SMILES
62+
2. Define the leaving group (by bond indices or atom list)
63+
3. Choose the ligand atom that will remain bound
64+
4. Choose the protein/RNA/DNA entity and residue
65+
5. Enter the target atom name (CCD atom name on the biomolecule side)
66+
6. Finalize the bond to generate `userCCD` data
67+
68+
![Covalent ligand workflow](images/leaving_group_af.jpg)
69+
70+
### 5. Generate and Download JSON
71+
72+
- Click **Generate JSON**
73+
- Review the JSON preview in the app
74+
- Click **Download JSON** and use the file as AlphaFold 3 input
75+
76+
## Current Limitations
77+
78+
- Covalent ligand mode currently supports **one ligand with one copy** at a time
79+
- The app validates common input issues, but it does not fully validate every AlphaFold 3 schema rule
80+
- `userCCD` export currently uses a single generated ligand definition
81+
82+
## Repository Layout
83+
84+
- `streamlit_app.py` — Streamlit UI and input flow
85+
- `utils.py` — JSON generation and ligand/mmCIF conversion helpers
86+
- `seqs.py` — sequence data model classes
87+
- `requirements.txt` — Python dependencies
88+
- `monomers.cif` — reference monomer definitions used by the project
89+
90+
## Troubleshooting
91+
92+
- **RDKit errors while rendering a ligand**
93+
- Check the SMILES string
94+
- Try a simpler ligand first
95+
- Some molecules may fail 3D embedding/optimization
96+
97+
- **Covalent options unavailable**
98+
- Ensure at least one protein/RNA/DNA entity is defined
99+
- Use exactly one ligand with one copy for covalent mode
100+
101+
- **Invalid JSON array fields**
102+
- Use valid JSON arrays such as `[]`, `[{"ptmType":"..."}]`, or `[{"template":"..."}]`
103+
104+
## License
50105

51-
Special thanks to the contributors and the AlphaFold team for their incredible work in advancing protein structure prediction.
106+
This project is licensed under the Apache License. See `LICENSE`.
52107

0 commit comments

Comments
 (0)