A computational toolkit for exploring HLA-B27 misfolding and drug discovery in Ankylosing Spondylitis.
Unfold uses AlphaFold 3's protein-ligand interaction predictions to investigate why HLA-B27 misfolds and screen small molecules that might stabilize it. Built by a developer with AS who got tired of waiting for someone else to do it.
Ankylosing Spondylitis (AS) is strongly linked to the HLA-B27 protein. The leading hypothesis: HLA-B27 misfolds in the endoplasmic reticulum, triggering an unfolded protein response (UPR) that causes chronic inflammation which attacks your joints and spine.
If we can find molecules that stabilize HLA-B27's folding, we might prevent the cascade that causes AS. That's what Unfold explores.
- Fetch — Pulls HLA-B27 structure, sequences, and annotations from AlphaFold DB, UniProt, and PDB
- Analyze — Identifies misfolding-prone regions via pLDDT confidence scoring and SASA analysis
- Compare — Compares HLA-B27:05 (AS-associated) vs B27:06 (protective) to find what makes one dangerous
- Screen — Prepares protein-ligand inputs for AlphaFold 3 Server and parses interaction predictions
- Visualize — Generates publication-quality charts, confidence heatmaps, and 3D structure views
unfold/
├── main.py # Pipeline orchestrator
├── config.py # Constants, paths, API endpoints
├── fetch/
│ ├── alphafold.py # AlphaFold DB structure + confidence data
│ ├── uniprot.py # Sequence, variants, annotations
│ └── chembl.py # Known AS-related compounds from ChEMBL
├── analyze/
│ ├── structure.py # PDB parsing, SASA, secondary structure
│ ├── confidence.py # pLDDT analysis, unstable region detection
│ └── pockets.py # Binding pocket identification
├── compare/
│ └── subtypes.py # B*27:05 vs B*27:06 structural comparison
├── screen/
│ ├── candidates.py # Curated small molecule library
│ ├── af3_input.py # Generate AlphaFold 3 Server JSON inputs
│ └── af3_output.py # Parse AF3 prediction results
├── visualize/
│ ├── confidence.py # pLDDT heatmaps
│ ├── docking.py # Screening result charts
│ ├── comparison.py # Subtype comparison plots
│ └── structure_3d.py # py3Dmol interactive viewer
├── data/
│ ├── cache/ # Downloaded structures & sequences
│ ├── af3_inputs/ # Generated AF3 Server input JSONs
│ ├── af3_outputs/ # AF3 Server result files
│ └── figures/ # Generated visualizations
├── requirements.txt
└── README.md
Windows (cmd):
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txtWindows (PowerShell):
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txtPowerShell note: if you get an execution policy error, run
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserfirst.
Linux / macOS:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtCommands are the same on all platforms once the venv is activated:
# Full analysis pipeline (no GPU needed)
python main.py
# Analysis only, skip screening prep
python main.py --skip-screening
# Custom pLDDT threshold for unstable regions
python main.py --threshold 60
# Generate AF3 Server inputs for screening
python main.py --prepare-af3
# Parse AF3 Server results after running predictions
python main.py --parse-af3 data/af3_outputs/Unfold doesn't require a local GPU. The workflow is:
- Unfold generates input JSONs for the AlphaFold Server
- You submit them to the server (free, non-commercial use)
- Unfold parses the results and scores binding interactions
For local AF3 inference (requires GPU + model weights):
- google-deepmind/alphafold3
- aqlaboratory/openfold-3 (fully open source)
- Subtype comparison: B27:05 causes AS, B27:06 protects against it. They differ by only 1 residue (position 116: Asp→His). Understanding why this single change affects folding is a major clue.
- Chemical chaperones: Compounds like 4-PBA and TUDCA stabilize protein folding in the ER. Could they work for HLA-B27?
- Peptide groove binding: Abacavir (an HIV drug) binds inside HLA-B*57:01's groove and changes peptide presentation. Could a similar approach work for B27?
MIT — go unfold something.