is a deep learning model designed for de novo peptide sequencing from Data-Independent Acquisition (DIA) mass spectrometry data. By leveraging the transformer architecture. This guide will help you get started with installation, dataset preparation, and running key functionalities like model training, evaluation, and prediction. Follow the instructions below to utilize Transformer-DIA effectively for your peptide sequencing tasks.
For more details about the model and its implementation, refer to our paper: Transformer-DIA: Transformer-based de novo peptide sequencing for data-independent acquisition mass spectrometry
To manage dependencies efficiently, we recommend using conda. Start by creating a dedicated conda environment:
conda create --name transdia_env python=3.10Activate the environment:
conda activate transdia_envInstall Transformer_DIA and its dependencies via pip:
pip install transdiaTo verify a successful installation, check the command-line interface:
transdia --helpTo use Transformer-DIA, you need to preprocess the data by generating a feature file. This feature file serves as an essential input for the model. We provide a script to streamline this process. The script processes spectrum and feature files to create the required feature file in pickle format. The generated features include:
- Keys: Peptide sequences
- Values: List containing the following attributes:
precursor_mzprecursor_chargescan_list_middlems1mz_listint_listneighbor_right_countneighbor_size_half
You can run the script by providing the paths to your spectrum and feature files as input. The script validates the inputs to ensure compatibility. Follow the instructions in the script prompts for seamless data preprocessing.
We used the feature and spectrum files released by the DeepNovo-DIA model, which are available here: MassIVE MSV000082368.
You can run the script by providing the paths to your spectrum and feature files as input. The script validates the inputs to ensure compatibility. Follow the instructions in the script prompts for seamless data preprocessing.
Annotated DIA datasets can be downloaded from the datasets page.
Transformer_DIA requires pretrained model weights for predictions in denovo or eval modes. Compatible weights (in .ckpt format) can be found on the pretrained models page.
Specify the model file during execution using the --model parameter.
Transformer_DIA predicts peptide sequences from MS/MS spectra stored in MGF files. Predictions are saved as a CSV file:
transdia --mode=denovo --model=pretrained_checkpoint.ckpt --peak_path=path/to/spectra.mgf --peak_feature=path/to/precursor_feature.pklTo assess the performance of de novo sequencing against known annotations:
transdia --mode=eval --model=pretrained_checkpoint.ckpt --peak_path=path/to/spectra.mgf --peak_feature=path/to/precursor_feature.pklAnnotations in the MGF file must include peptide sequences in the SEQ field.
To train a new Transformer model from scratch, provide labeled training and validation datasets in MGF format:
transdia --mode=train --peak_path=path/to/train/annotated_spectra.mgf \
--peak_feature=path/to/train/precursor_feature.pkl \
--peak_path_val=path/to/validation/annotated_spectra.mgf \
--peak_feature_val==path/to/validation/precursor_feature.pklMGF files must include peptide sequences in the SEQ field.
To fine-tune a pretrained Transformer-DIA model, set the --train_from_scratch parameter to false:
transdia --mode=train --model=pretrained_checkpoint.ckpt \
--peak_feature=path/to/train/precursor_feature.pkl \
--peak_path_val=path/to/validation/annotated_spectra.mgf \
--peak_feature_val==path/to/validation/precursor_feature.pkl