Skip to main content

Classify variants of uncertain significance using AlphaFold-predicted protein structures and graph neural networks.

Project description

VariantFold

Classify Variants of Uncertain Significance (VUS) using AlphaFold-predicted protein structures and Graph Neural Networks.

VariantFold leverages protein structure predictions from ColabFold/AlphaFold and a Graph Convolutional Network (GCN) to classify VUS based on the standardised ACMG-AMP variant classification system.

Workflow

ClinVar data → Parse variants → Mutate sequences → ColabFold 3-D prediction
    → PDB-to-graph conversion → Train GCN (benign vs pathogenic) → Classify VUS
  1. Parse — Extract missense variants from ClinVar downloads (benign, pathogenic, VUS).
  2. Mutate — Apply each variant to the reference protein sequence.
  3. Predict — Run ColabFold to generate 3-D structure models for every variant.
  4. Convert — Transform PDB files into PyTorch Geometric residue-level graphs with rich node features (one-hot amino acid, 3-D coordinates, pLDDT).
  5. Train — Train a multi-layer GCN on the benign vs pathogenic graph dataset.
  6. Classify — Run the trained model on VUS structures to predict likely benign / likely pathogenic with probabilities.

Installation

# Core package (graph conversion + GCN training/inference)
pip install .

# With ColabFold for structure prediction (GPU recommended)
pip install ".[structure]"

# With visualisation tools
pip install ".[viz]"

# Everything
pip install ".[all]"

Quick start — Python API

from variantfold import VariantFoldConfig, VariantFoldPipeline

cfg = VariantFoldConfig(
    gene_symbol="VHL",
    entrez_email="your_email@example.com",
)

pipe = VariantFoldPipeline(cfg)
pipe.step1_parse_variants()       # Parse ClinVar files + fetch sequence
# pipe.step2_predict_structures() # Run ColabFold (long — needs GPU)
pipe.step3_collect_models()       # Gather best PDB models
metrics = pipe.step4_train()      # Train GCN
print(f"Test accuracy: {metrics['accuracy']:.2%}")

vus_df = pipe.step5_classify_vus()
print(vus_df)

Quick start — CLI

# Run steps 1, 3, 4, 5 (assumes PDB libraries are already populated)
variantfold run --gene VHL --email you@example.com --steps 1,3,4,5

# Standalone inference on new PDB files
variantfold predict --model variantfold_VHL/variantfold_model.pt \
                    --pdb-dir ./new_vus_pdbs/

Input data

Place these files in the working directory (./variantfold_<gene>/):

File Description
clinvar_result_bng.txt ClinVar download filtered to benign variants
clinvar_result_ptg.txt ClinVar download filtered to pathogenic variants
clinvar_result_vus.txt ClinVar download filtered to VUS (optional)

Download from ClinVar using the tab-delimited download with default settings.

Configuration

All parameters are set via VariantFoldConfig:

cfg = VariantFoldConfig(
    gene_symbol="TP53",
    entrez_email="you@example.com",
    distance_threshold=6.5,   # Å, residue contact cutoff
    gcn_hidden_dim=64,        # GCN layer width
    gcn_num_layers=3,         # depth
    epochs=200,
    learning_rate=0.01,
    train_fraction=0.8,
    use_residue_features=True, # 24-dim features (set False for legacy 1-dim)
)

Development

pip install -e ".[dev]"
pytest

Licence

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

variantfold-0.9.0.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

variantfold-0.9.0-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file variantfold-0.9.0.tar.gz.

File metadata

  • Download URL: variantfold-0.9.0.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for variantfold-0.9.0.tar.gz
Algorithm Hash digest
SHA256 f1b9e211626b2b6be24ad1f1e4c9ff0a760cf4d0754a7748e443584596e3f902
MD5 c9732d242d837b48aa1e4e44c122a0ad
BLAKE2b-256 3ca419aca72c5572d344e553f7434fedd9a88e49e5ffbf83382b13ead9b24d02

See more details on using hashes here.

File details

Details for the file variantfold-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: variantfold-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for variantfold-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31e73991abf2faed97c9c3be4745a7b8db2b3fa47aa0caa1d14a2d04a2d92253
MD5 e1d8fc0d68cfbc2227db8741cf0df2d9
BLAKE2b-256 2191786904d3b7ef466f9a7f32ca6e6dbcf9ae1fade6639e97f6beb258a857b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page