Skip to content

PAMPA CLASSIFY

touzet edited this page Dec 13, 2025 · 31 revisions

PAMPA CLASSIFY is for species identification. It processes a set of MS spectra as input and determines the best taxonomic assignment for each spectrum using a database of peptide markers. For that, PAMPA includes a selection of curated peptide markers. Users also have the option to provide their own customized set of peptide markers. When marker peptides are not available, genetic sequences can be supplied to enable the automatic inference of peptides through in silico digestion. You can also provide a taxonomy to enable the program to interpret diverse assignment possibilities within the taxonomic space.

PAMPA CLASSIFY is capable of processing any number of mass spectra in a single run.

Quick start

In its most basic usage, PAMPA CLASSIFY requires four parameters:

  • -s: path to the spectra files to process. Authorized formats are cvs, mgf and mzML. See Mass spectra
  • -e: error margin tolerance for the peaks (in Dalton or ppm),
  • --mammals: use all mammals for the search,
  • -o: name of the main output file .

The peptide table corresponding to the mammal model is visible at https://docs.google.com/spreadsheets/d/1nwELNshZxF0h6DkIFNAYXDJqmq4NOSUOLWQlTZIzUDQ

Example

  1. Download the Spectra.zip file.
  2. Unizip it. The archive contains six MALDI-TOF spectra.
  3. Type the command
python3 pampa_classify.py -s Spectra -e 0.1 -o results.tsv --mammals

This command executes the program on all mass spectra within the 'Spectra' directory. The taxonomic model utilized is 'mammals', and the error margin tolerance for masses is set to 0.1 Da.

The primary output file is results.tsv. It can be opened with any spreadsheet tool. For each spectrum, it provides the best assignment, determined by the lowest P-value. The file includes the following information:

  • Peaks from the spectrum that match the peptide markers of the database,
  • Pvalue: P-value of the assignment,
  • Score: total number of matching peptide markers,
  • Assignment: smallest subtree of the taxonomy that is compatible with the set of species found,
  • Rank: taxonomic rank of the assignment (e.g. species, genus, family),
  • Uncertainty: largest subtree of the taxonomy that is compatible with the set of species found,
  • Species: list of species supporting the assignment.

Download : results.tsv

Two other accompanying files are automatically created, in the same directory.

  • detail_results.tsv (TSV file): This file contains the detail of the assignment, which markers are found for which species. It also provides the intensity of the peaks used in the assignment.

  • report_results.txt (TXT file): This is an auxiliary file that provides details about the job, including number of mass spectra, number of species tested, parameters, and other related information.

Warnings generated during execution are reported in the warning.log file.

Full command-line

python3 pampa_classify.py 
	[-h]
	(-s SPECTRA PATH)
	(-e ERROR MARGIN)
	(-o OUTPUT FILE)
	(--mammals | -p PEPTIDE TABLE... | -f FASTA file | -d FASTA dir)
	[-l LIMIT]
	[-t TAXONOMY]
	[-n NEIGHBOURING]
	[-a]
	[--deamidation]

This script is for species identification.

options:
  -h, --help            show this help message and exit

Mandatory options:
  -s SPECTRA            Path to the spectra files 
  -e ERROR              Error margin tolerance for the observation (in Dalton or ppm). 
                        Recommended values: 0.02 for MALDI-FTICR and 0.1 for MALDI-TOF.
  -o OUTPUT             Output path (should include the output file name)

Selection of organisms, basic usage:
  --mammals             Use pre-computed peptide table and taxonomy for mammals.

Selection of organisms, advanced usage:
  -p PEPTIDE_TABLE [PEPTIDE_TABLE ...]
                        Peptide table(s) (TSV file(s))
  -f FASTA              FASTA sequences.
  -d DIRECTORY          Directory where to find FASTA files.
  -t TAXONOMY           Taxonomy (TSV file), optional.

Limiting search : 
  -l LIMIT              Limit the set of peptides or FASTA sequences to organisms, molecules 
                        or sequence ID specified in this file (text file).

Applying deamidation:
  --deamidation         Apply deamidation to peptide markers. Can be used in conjunction with the 
                        -l option to specify the list of peptide  markers to process. By default, 
                        all markers are processed.

Options for suboptimal solutions:
  -n NEIGHBOUR          Provide near-optimal solutions within a specified percentage margin, 
                        ranging between 0 and 100. Default is 100.  With -n 100, only optimal 
                        solutions are computed. 
  -a                    Provide all solutions within the percentage margin specified with option 
                        -n, and not only suboptimal solutions. Default is False.

Mandatory options: spectra and output file

Mass spectra (-s)

The program processes a batch of mass spectra simultaneously. All mass spectra files are contained within the same folder, with one of the following extensions: .csv or .txt (in CSV format), .mgf (in MGF format), or .mzML (in mzML format). Any other files present will be disregarded. See Mass spectra for more information about the format and the requirements.

Error margin tolerance (-e)

The error margin is related to the resolution of the mass spectrometer and its ability to distinguish closely spaced peaks. This is the maximal deviation between a peak and the theoretical mass of the peptide marker. This option can be expressed in Dalton or in ppm (parts per million).

  • If the value is smaller than 1, it is assumed to be in Da (Daltons). In this case, recommended values are 0.1 for MALDI-TOF, and 0.02 for MALDI-FTICR.
  • If the value is larger than 1, it is assumed to be in ppm. In this case, recommended values are 50 for MALDI-TOF, and 5 for MALDI-FTICR.

Output files (-o)

This option is for the name of the main output file, in TSV format. You can include the desired path to the directory where the file should be created. If the specified directory does not exist, it will be created automatically.

Selection of organisms, basic usage

With the option --mammals, PAMPA utilizes a predefined set of peptide markers in conjunction with the NCBI taxonomy for mammals. The markers are accessible through peptide tables, which are distributed with the code (see the Peptide tables page) along with the taxonomy (see the Taxonomy page). Please avoid modifying these files in PAMPA source code, as it may damage the behaviour of the program.

If you want to use custom peptide tables containing your own set of peptide markers, or generate markers form genetic sequences, you may use option -p, -t, -f and -d options, which allows for more flexibility. These options are described below.

Selection of organisms, advanced usage (-p, -f, -d, -t)

Peptide table (-p)

This option allows you to employ your own set of peptide markers. This set should be structured within a peptide table, formatted as a TSV (Tab-Separated Values) file. The specific format details for peptide tables are described in the Peptide tables section.

Note that you can specify multiple peptide tables by using the -p option repeatedly.

Running the program without peptide tables: -f and -d

When no peptide markers are available, it is possible to provide FASTA sequences for the representative species instead. These sequences will undergo in silico digestion to identify all tryptic peptides, allowing for up to one missed cleavage. Masses are then automatically computed.

The provided sequences can be available either in a (multi-)FASTA file ('-f'option), or in a directory containing FASTA files ('-d' option). In both cases, the set of sequences can optionally be limited to a subset of organisms, molecules or sequence identifiers with '-l' option.

Option -f : The specified file can contain an arbitrary number of FASTA sequences, coming from various organisms. Refer to the FASTA sequences section for details on the syntax used in FASTA headings.

Option -d: The directory can contain an arbitrary number of FASTA files, following the same requirements as with '-f' option. Only files with extension .fa or .fasta will be examined.

Taxonomy (-t)

The program provides an optional feature to include taxonomic information in species identification. In this scenario, you can either provide a taxonomy file or utilize a pre-defined taxonomy file available in the Taxonomy directory. Instructions for constructing your own taxonomy file are detailed in the Taxonomy section.

When this option is invoked, the software will indicate, for each spectrum, the taxonomic resolution of the assignment. This is computed as the largest clade of the taxonomy that is compatible with the prediction.

Deamidation

--deamidation option allows up to one deamidation to all peptide markers containing at least one asparagine or one glutamine. By default, all markers are processed. This option can be used in conjunction with the -l option with the tag Deamidation to specify the list of peptide markers to process. See below and Limiting searches.

Options to limit the search (-l)

It is possible to filter the marker peptides to consider to limit the search according to various criteria such as organism (OS=), taxid (OX=), gene name (GN=), sequence identifier (SeqID=), PTMs (PTM=), markers etc. For that, you can use the '-l' option together with a limit file . The full description of the syntax is given in section Limiting searches.

Options for suboptimal solutions (-n and -a)

By default, PAMPA identifies the species with the lower P-value. The -n option allows to obtain also near-optimal solutions. For that, you can set the suboptimality range as a percentage from 0 to 100, with the default being 100 (corresponding to solutions with the highest number of marker peptides). For example, if the optimal solution has 11 marker peptides, '-n 80' will provide solutions with 9 markers or more.

The '-a' option is linked to the '-n' option and modifies its behaviour. When the '-n' option is used alone, it generates only near-optimal solutions that are not included in any other solution. However, when used together with '-n,' the '-a' option makes the program compute all solutions, even those that are included in other solutions.

Clone this wiki locally