Skip to main content

Transformer_DIA

Transformer-based de novo peptide sequencing for data-independent acquisition mass spectrometry.

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.

Paper

For more details about the model and its implementation, refer to our paper: Transformer-DIA: Advanced De Novo Peptide Sequencing


Installation

To manage dependencies efficiently, we recommend using conda. Start by creating a dedicated conda environment:

conda create --name transdia_env python=3.10

Activate the environment:

conda activate transdia_env

Install Transformer_DIA and its dependencies via pip:

pip install transdia

To verify a successful installation, check the command-line interface:

transdia --help

Dataset

Data Preprocessing

To 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_mz
    • precursor_charge
    • scan_list_middle
    • ms1
    • mz_list
    • int_list
    • neighbor_right_count
    • neighbor_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.

Download DIA Datasets

Annotated DIA datasets can be downloaded from the datasets page.


Download Pretrained Model Weights

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.


Usage

Predict Peptide Sequences

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.pkl

Evaluate de novo Sequencing Performance

To 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.pkl

Annotations in the MGF file must include peptide sequences in the SEQ field.


Train a New Model

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.pkl

MGF files must include peptide sequences in the SEQ field.


Fine-Tune an Existing Model

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

Release files for transformer-dia 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transformer-dia 0.0.3
File Size Uploaded
transformer_dia-0.0.3.tar.gz 144.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for transformer-dia 0.0.3
File Interpreter ABI Platform
transformer_dia-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 315.9 kB

Release files / transformer_dia-0.0.3.tar.gz

Download URL transformer_dia-0.0.3.tar.gz
Size 144.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d591c482bacc97c1084ce1bd2c6118c95f8a3a73534ce87933461f7067fe4827
BLAKE2b-256 checksum
How to use checksums
fe5520f11fb70ee16da4e03f18acf316d0ac65054df301e32c8d1ed292a138b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.19

Release files / transformer_dia-0.0.3-py3-none-any.whl

Download URL transformer_dia-0.0.3-py3-none-any.whl
Size 171.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8665ae69842b3ad05ade4ecb2ccc56f1f26c3b992eb85db717eeaab8180ef8b6
BLAKE2b-256 checksum
How to use checksums
455f9c3002c04c17d1fd231221f947bcb2f25a79102eca79d50557cbaba7cc7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page