A Toolkit for Epitope Selection and Population Coverage Optimization
Welcome to EpiWeight! This repository contains tools for epitope downselection and optimization, particularly focusing on T-cell epitope selection based on binding affinity, population coverage, and conservation.
EpiWeight provides methods for:
- Filtering epitopes based on binding affinity thresholds for specific HLA alleles
- Optimizing epitope selection to maximize population coverage while minimizing redundancy
- Ensuring diversity in selected epitopes by considering protein sources and avoiding overlapping sequences
- Identifying optimal protein regions for vaccine design
- Calculating exact population coverage using phenotypic frequencies
The latest iteration of TepiNom provides a single, refactored script (tepinom_1.6.py) that handles both MHC Class I and MHC Class II epitope optimization using Integer Linear Programming (ILP).
Key Features:
- Two optimization modes:
- Combo mode: Select optimal epitope combinations for maximum population coverage
- Region mode: Identify protein regions with highest immunogenic potential using sliding windows
- Phenotypic frequency-based population coverage for accurate prevalence calculations
- High-risk HLA prioritization with configurable weights
- Protein diversity constraints to avoid redundant epitope selection
- Adaptive region selection: Automatically returns all regions achieving 100% coverage, or top N if none reach 100%
- Support for both MHC Class I (CD8+ T-cell epitopes: HLA-A, HLA-B, HLA-C) and MHC Class II (CD4+ T-cell epitopes: DRB1, DPA1, DQA1)
See tepinom/README.md for detailed documentation.
tepinom_mhci_arg.py– Original MHC Class I epitope selection scripttepinom_mhcii_arg.py– Original MHC Class II epitope selection script
Note: These are maintained for backward compatibility. New projects should use tepinom_1.6.py.
TepiNom uses Integer Linear Programming to optimize epitope selection by:
-
Filtering epitopes based on:
- Binding affinity to HLA alleles (rank-based thresholds)
- Conservation scores across protein variants
-
Optimizing selections to:
- Maximize population coverage using phenotypic frequency calculations
- Consider intra-locus and inter-locus HLA coverage
- Apply weights to high-risk or priority HLA alleles
- Enforce protein diversity (optional)
-
Region Analysis (optional):
- Identify contiguous protein regions with high immunogenic potential
- Use sliding windows of customizable sizes (e.g., 50aa, 100aa, 200aa)
- Rank regions by population coverage
git clone https://github.com/alexlaurenson/epiweight
cd epiweightDependencies:
pip install pandas numpy pulpSolver Required: TepiNom requires the CBC (COIN-OR Branch and Cut) solver for ILP optimization.
- Ubuntu/Debian:
sudo apt-get install coinor-cbc - macOS:
brew install coin-or-tools/coinor/cbc - Windows: Download from COIN-OR website
python3 tepinom_1.6.py \
epitopes.txt \
hla_frequencies.txt \
--postfilter \
--mhc_class i \
--goal combo \
--ba_rank_hit 0.5 \
--max_epitopes 20 \
--out_dir output/python3 tepinom_1.6.py \
epitopes.txt \
hla_frequencies.txt \
--postfilter \
--mhc_class ii \
--goal region \
--window_size 100 \
--ba_rank_hit 1.0 \
--out_dir output/python3 tepinom_1.6.py \
epitopes.txt \
hla_frequencies.txt \
--postfilter \
--mhc_class i \
--goal combo \
--ba_rank_hit 0.5 \
--high_risk_hlas HLA-A*29:02,HLA-A*30:01 \
--hla_weight 5.0 \
--out_dir output/Epitope Position ConservationScore Source Stage HLA-A*01:01 HLA-A*02:01 ...
SHNGFWSVP 145 0.95 Protein1 Sporozoite 0.3 1.2 ...
KGVNINSPK 289 0.88 Protein2 Liver 2.1 0.4 ...
HLA-A*01:01 0.1234
HLA-A*02:01 0.2456
HLA-B*07:02 0.0987
optimized_epitopes_*.tsv: Selected epitopes with individual coverage metricspopulation_coverage_*.tsv: Progression showing coverage for increasing epitope counts
region_coverage_*.tsv: Top protein regions ranked by coverageoptimized_epitopes_region_*.tsv: All epitopes from top regions with individual metrics
Num_Epitopes Best_Combination HLA-A_Cov_pct HLA-B_Cov_pct HLA-C_Cov_pct Total_Cov_pct
1 SHNGFWSVP 45.23 38.67 22.45 72.35
2 SHNGFWSVP,KGVNINSPK 67.89 58.92 41.23 88.47
3 SHNGFWSVP,KGVNINSPK,MARTYGSA 78.45 72.34 55.67 94.28
- Protein diversity enforcement: Use
--prioritize_protein_diversityto select at most one epitope per protein - Hard constraints: Use
--hard_constraintto require coverage of specified high-risk HLAs - Adaptive region selection: Automatically identifies all regions with 100% coverage (region mode only)
- Conservation filtering: Set minimum conservation scores with
--conservation_score
Want to improve EpiWeight or add new features? Feel free to fork this repo, submit pull requests, or open issues for discussions.
If you use TepiNom in your research, please cite:
[Citation details to be added]
EpiWeight is licensed under the Apache 2.0 License.
Have questions? Found a bug? Feel free to open an issue or reach out!
Maintainer: Alex Laurenson
Repository: https://github.com/alexlaurenson/epiweight