Machine learning models for neoantigen candidate classification in personalized cancer vaccine design
NEAT contains models and analysis code for classifying neoantigen candidates as Accept, Review, or Reject, using expert Immunogenomics Tumor Board (ITB) evaluations and genomic, expression, and MHC binding features.
The repository has two workflows with separate dependency files and model artifacts:
| Section | Purpose | Instructions | Dependencies |
|---|---|---|---|
| Manuscript | Reproduce figures, repeated model-development analyses, and a demonstration prediction | Manuscript README | manuscript/requirements.txt |
| Model development | Encode data, retrain the revised pVACtools 7.2 model, and predict new cases | Scripts README | model_development/requirements.txt |
Run the commands below from the NEAT repository root. Use separate Python environments for the two workflows.
NEAT/
├── README.md
├── LICENSE
├── manuscript/ # Documents scripts and data to reproduce analysis
│ ├── README.md
│ ├── requirements.txt
│ ├── manuscript_final_model/ # The final model trained on all samples in the development set
│ ├── manuscript_interim_model/ # The interim model
│ ├── data/
│ └── scripts/
└── model_development/ # Used for future model development
├── requirements.txt
├── data/ # Pre-encoding and encoded tables for future training
├── scripts/
│ ├── README.md
│ ├── encode_missing.py
│ ├── train_model.py
│ └── predict.py # 7.2 model with missingness encoding
└── model/
├── pvactools7.2_model/ # Revised model and saved evaluations
└── pvactools7.0_model/ # Legacy model, imputer, and encoders
For a fresh environment:
conda create -n neoantigen_ml python=3.13 pip
conda activate neoantigen_ml
python -m pip install -r manuscript/requirements.txtpython manuscript/scripts/prospective_cohort_analysis/run_all.py
python manuscript/scripts/review_time_analysis.pyThe prospective workflow reads the ready prospective_model_comparison.csv. It generates probability comparisons, ROC/PR curves, confusion matrices, and interim-model threshold sensitivity with and without calibration patients. Data preparation and original prediction tables are not required.
Outputs are saved under manuscript/results/prospective_cohort/ (35 PNGs plus
threshold data/manifests) and manuscript/results/review_time_analysis/ (one ECDF
PNG). See the prospective instructions
for individual analyses.
The 100-iteration workflow
compares four models, peptide and patient splits, and two preprocessing
strategies. It reads the supplied datasets in
manuscript/data/missing_data_handeling/ and saves empirical 95% intervals and
the combined performance table under manuscript/results/model_development_CIs/.
For the two original interim random forests on the fixed training/test split:
python manuscript/scripts/ml_randomforest_interim_model.py --jobs 2This reads manuscript/data/interim_model_training_testing_data/ and writes
models, tuning results, and plots under manuscript/results/randomforest/.
The fixed split shares patients between training and testing. Full training
searches can take substantial time; see the manuscript instructions
for details.
python manuscript/scripts/predict_final_model.pyThe demo reads three Test.*.tsv files from
manuscript/data/predict_new_case_data/, adds Strategy 2 missingness indicators,
fills missing predictors with -1, and uses
manuscript_final_model/model_bundle.joblib.
It writes the aggregated prediction TSV under
manuscript/data/manuscript_prediction_results/.
For another sample:
python manuscript/scripts/predict_final_model.py \
--sample SAMPLE \
--data-dir /path/to/pvacseq_tables \
--output-dir /path/to/predictionsSupply <sample>.MHC_I.all_epitopes.aggregated.tsv,
<sample>.MHC_I.all_epitopes.tsv, and
<sample>.MHC_II.all_epitopes.aggregated.tsv.
See the final-model instructions
for details about the saved bundle and its version warning.
In a separate environment, install the model-development dependencies and run:
python -m pip install -r model_development/requirements.txt
python model_development/scripts/encode_missing.py
python model_development/scripts/train_model.py \
--input model_development/data/merged_df_encoded.csv \
--output-dir model_development/model/pvactools7.2_retraining \
--jobs 2encode_missing.py reads model_development/data/merged_df_pre_imputation.csv
and writes merged_df_encoded.csv in the same directory, adding WT/MT/RNA
missingness indicators and filling supported missing measurements with -1.
train_model.py tunes a balanced random forest by three-fold row-level
cross-validation, then fits all eligible rows. It saves model_bundle.joblib,
best parameters, CV results, OOB diagnostics, and feature importance. Use the
explicit input path above because its built-in input default is outdated. The
output directory must be empty; retraining does not replace the saved 7.2 model
automatically or evaluate the prospective cohort.
The existing
pvactools7.2_model directory
contains random_forest_ds_pvactools7.2.joblib and saved CV, OOB, and prospective
evaluation outputs. See the scripts README
for inputs, outputs, and usage of each script.
python model_development/scripts/predict.pyThis reads the bundled manuscript demo TSVs and writes
model_development/data/Test.MHC_I.all_epitopes.aggregated.ML_predict.tsv.
It applies pvactools7.2_model/label_encoders_numpy126.pkl, adds WT/MT/RNA
missingness indicators, replaces missing predictors with -1, and scores using
random_forest_ds_pvactools7.2.joblib. Use --sample, --data-dir, and
--output-dir for another case. The output TSV format is preserved.
The previous model, imputer, and encoders remain in
pvactools7.0_model/.
Previous impute_missing.py and old_train.py scripts are retained under
pvactools7.0_model/archived/ as historical references. The current predictor
uses missingness encoding and the 7.2 bundle.
For pVACseq/pVACview integration, consult the pVACtools documentation.
The development analysis uses 1,237 eligible candidates from 21 patients (from 1,324 rows before excluding development cases labeled Review). The prospective cohort contains 706 candidates from 12 patients, for 1,943 analysis candidates across 33 patients.
The cohorts span eight cancer types from three clinical trials at Washington University School of Medicine:
| Trial | Cancer type | Patients |
|---|---|---|
| NCT05111353 | Pancreatic cancer | 14 |
| NCT03606967 | Metastatic TNBC | 11 |
| NCT05741242 | Basket trial (multiple types) | 8 |
The supplied feature tables use anonymized pt_XX patient IDs. They include ITB
labels and genomic, expression, and MHC prediction features; Strategy 2 adds
three missingness indicators to the 72 predictors. The patient-ID mapping is
not included and is not required to run the manuscript analyses. Clinical
genomic source data are not included due to IRB restrictions.
If you use pVACml or the associated model in your work, please cite:
Yao J, Singhal K, Kiwala S, et al.
Automating immunogenomic tumor board decision-making for neoantigen cancer vaccine design.
[Journal] (2025). DOI: [pending]
For questions about the model or codebase, please open an issue. For questions related to the pVACtools integration, see the pVACtools GitHub.