Mhcquant
Identify and quantify MHC eluted peptides from mass spectrometry raw data
Install / Use
/learn @nf-core/MhcquantREADME
Introduction
nfcore/mhcquant is a best-practice bioinformatics pipeline to process data-dependent acquisition (DDA) immunopeptidomics data. This involves mass spectrometry-based identification and quantification of immunopeptides presented on major histocompatibility complex (MHC) molecules which mediate T cell immunosurveillance. Immunopeptidomics has central implications for clinical research, in the context of T cell-centric immunotherapies.
The pipeline is based on the OpenMS C++ framework for computational mass spectrometry. Spectrum files (mzML/Thermo raw/Bruker tdf) serve as inputs and a database search (Comet) is performed based on a given input protein database. Peptide properties are predicted by MS²Rescore. FDR rescoring is applied using Percolator or Mokapot based on a competitive target-decoy approach. The pipeline supports both local FDR control (per sample-condition group) and global FDR control (across all samples). For label-free quantification, all input files undergo identification-based retention time alignment and targeted feature extraction matching ids between runs. The pipeline can also generate spectrum libraries suitable for DIA-based searches as well as computing consensus epitopes using epicore.

The pipeline is built using Nextflow, a workflow tool to run tasks across multiple compute infrastructures in a very portable manner. It uses Docker/Singularity containers making installation trivial and results highly reproducible. The Nextflow DSL2 implementation of this pipeline uses one container per process which makes it much easier to maintain and update software dependencies. Where possible, these processes have been submitted to and installed from nf-core/modules in order to make them available to all nf-core pipelines, and to everyone within the Nextflow community!
On release, automated continuous integration tests run the pipeline on a full-sized dataset on the AWS cloud infrastructure. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources. The results obtained from the full-sized test can be viewed on the nf-core website.
Usage
[!NOTE] If you are new to Nextflow and nf-core, please refer to this page on how to set-up Nextflow. Make sure to test your setup with
-profile testbefore running the workflow on actual data.
First, prepare a samplesheet with your input data that looks as follows:
samplesheet.tsv
ID Sample Condition ReplicateFileName
1 tumor treated /path/to/msrun1.raw|mzML|d
2 tumor treated /path/to/msrun2.raw|mzML|d
3 tumor untreated /path/to/msrun3.raw|mzML|d
4 tumor untreated /path/to/msrun4.raw|mzML|d
Each row represents a mass spectrometry run in one of the formats: raw, RAW, mzML, mzML.gz, d, d.tar.gz, d.zip
Now, you can run the pipeline using:
nextflow run nf-core/mhcquant \
-profile <docker/singularity/.../institute> \
--input 'samplesheet.tsv' \
--fasta 'SWISSPROT_2020.fasta' \
--outdir ./results
Optional parameters for additional functionality:
# Enable quantification, global FDR and spectrum library generation, ion annotations, and consenus epitopes
nextflow run nf-core/mhcquant \
--input 'samplesheet.tsv' \
--fasta 'SWISSPROT_2020.fasta' \
--annotate_ions \
--epicore \
--generate_speclib \
--global_fdr \
--quantify \
--outdir ./results \
-profile docker
[!WARNING] Please provide pipeline parameters via the CLI or Nextflow
-params-fileoption. Custom config files including those provided by the-cNextflow option can be used to provide any configuration except for parameters; see docs.
For more details and further functionality, please refer to the usage documentation and the parameter documentation.
Pipeline summary
Default Steps
By default the pipeline currently performs identification of MHC class I peptides with HCD settings:
- Spectra Preparation: Preparing spectra dependent on the input format (
PREPARE_SPECTRAsubworkflow) - Database Preparation: Creation of reversed decoy database (
DecoyDatabase) - Peptide Identification: Identification of peptides in the MS/MS spectra (
CometAdapter) - Database Indexing: Refreshes protein references for all peptide hits and adds target/decoy information (
PeptideIndexer) - Identification Merging: Merges identification files with the same
SampleandConditionlabel (IDMerger) - Rescoring: Feature prediction and peptide-spectrum-match rescoring (
RESCOREsubworkflow)- Prediction of retention times and MS2 intensities (
MS²Rescore) - Extract PSM features for rescoring engines (
PSMFeatureExtractor) - Peptide-spectrum-match rescoring using Percolator or Mokapot (
PercolatorAdapter) - Filters peptide identification result according to configurable FDR threshold (
IDFilter)
- Prediction of retention times and MS2 intensities (
- Export: Converts identification result to tab-separated files (
TextExporter)
FDR Control Modes
The pipeline supports two FDR control strategies:
- Local FDR (default): FDR control applied per
SampleandConditiongroup - Global FDR: FDR control applied across all samples in the dataset (enable with
--global_fdr)
Additional Steps
Additional functionality contained by the pipeline currently includes:
Quantification (QUANT subworkflow)
When enabled with --quantify, the pipeline performs label-free quantification:
- Alignment: Corrects retention time distortions between runs (
MAP_ALIGNMENTsubworkflow)- Corrects retention time distortions between runs (
MapAlignerIdentification) - Applies retention time transformations to runs (
MapRTTransformer)
- Corrects retention time distortions between runs (
- Feature Processing: Detects and processes features (
PROCESS_FEATUREsubworkflow)- Detects features in MS1 data based on peptide identifications (
FeatureFinderIdentification) - Group corresponding features across label-free experiments (
FeatureLinkerUnlabeledKD) - Resolves ambiguous annotations of features with peptide identifications (
IDConflictResolver)
- Detects features in MS1 data based on peptide identifications (
Spectrum Library Generation (SPECLIB subworkflow)
When enabled with --generate_speclib, the pipeline generates spectrum libraries suitable for DIA-based searches. Outputs one library per sample or a single library across all samples (if global FDR mode is enabled with --global_fdr).
Ion Annotation (IONANNOTATOR subworkflow)
The pipeline annotates the final list of peptides with their respective ions and charges:
- Annotates final list of peptides with their respective ions and charges (
IonAnnotator)
