PSM View¶
The PSM (Peptide Spectrum Match) view captures spectrum-level identification
results. Each row represents a single match between a mass spectrum and a
peptide sequence, including the identification scores, optional spectral data,
and protein mappings. Its mandatory opaque psm_id is the primary key. A
producer-supplied ID is preserved by default; otherwise QPX derives the ID from
the footer-declared identity_composite, whose schema default is
[run_file_name, scan, peptidoform, charge]. An id is meaningful within one file;
see Row Identity.
That composite names one peptidoform per spectrum. A file with several hits of
one peptidoform and charge for a spectrum (other engines, or cross-links) needs
a producer-supplied psm_id, as qpxc convert mzidentml writes from its
SpectrumIdentificationItem ids, or an extended composite.
De novo sequencing workflows set is_decoy to false and may omit
protein_accessions. Record the workflow with a de_novo_peptide_sequencing
step in provenance.parquet.
Use Cases¶
- AI/ML training: Provides peptide-spectrum pairs with optional spectral arrays (m/z, intensity, ion types) for training intensity prediction, de novo sequencing, and clustering models.
- Spectrum-level analysis: Enables detailed inspection of individual identifications, including retention time, charge state, and search engine scores.
- DDA identification results: Designed primarily for data-dependent acquisition (DDA) workflows where each spectrum yields one or more peptide identifications.
Schema¶
Identity¶
| Field | Description | Type | Required |
|---|---|---|---|
psm_id |
Opaque primary key, supplied by the producer or derived by QPX from the footer-declared identity_composite |
int64 | yes |
Core Identification Fields¶
| Field | Description | Type | Required |
|---|---|---|---|
sequence |
Unmodified peptide amino acid sequence | string | yes |
peptidoform |
Peptide sequence with modifications in ProForma notation | string | yes |
modifications |
Structured list of modifications with name, accession, position, and localization scores | array[struct], null | no |
modification_candidates |
Every modification considered at each position, assigned or competing, with its probability given this identification (see Competing interpretations); optional column | array[struct], null | optional |
charge |
Charge state of the precursor ion | int16 | yes |
posterior_error_probability |
Posterior error probability (PEP) for the peptide-spectrum match — the probability that the PSM is incorrect. Lower values indicate higher confidence (lower is better). Ranges from 0.0 (confident) to 1.0 (likely incorrect) | float64, null | no |
is_decoy |
Whether the PSM is a decoy match (true) or a target match (false); use false when no target-decoy search was used. A peptide that matches both target and decoy proteins (OpenMS target_decoy = target+decoy) is a target match |
bool | yes |
calculated_mz |
Theoretical peptide mass-to-charge ratio based on identified sequence and modifications; null when it cannot be calculated | float32, null | yes |
observed_mz |
Experimental observed peptide mass-to-charge ratio; null when the producer reports no measured precursor m/z | float32, null | yes |
mass_error_ppm |
Mass error in ppm: 1e6 × (observed_mz − calculated_mz) / calculated_mz | float32, null | no |
missed_cleavages |
Number of missed enzymatic cleavages | int16, null | no |
rt |
MS2 scan's retention time (in seconds) | float32, null | no |
qvalue |
PSM-level q-value, filled from additional_scores (typed q-values); specification 1.3 |
float64, null | no |
predicted_rt |
Predicted retention time of the peptide (in seconds) | float32, null | no |
run_file_name |
Spectrum file name without path or extension | string | yes |
scan |
Scan identifier as an array of integer components (e.g., [43920] for single-scan instruments, [10, 1, 345] for Waters function/process/scan) |
array[int32] | yes |
additional_scores |
List of score structures with name, value, and direction indicator | array[struct], null | no |
cv_params |
Optional list of controlled vocabulary parameters for additional metadata | array[struct], null | no |
protein_accessions |
Protein accessions of all proteins that the peptide maps to; null when the producer has no protein mapping, which can be recovered from the feature and protein group views | array[string], null | no |
Optional Fields¶
These fields are optional and may not exist in the file at all. They are included based on conversion settings or user preference.
| Field | Description | Type | Required |
|---|---|---|---|
cross_links |
Cross-link information for XL-MS experiments. Each entry describes one cross-link site. null for non-cross-linked PSMs |
array[struct], null | optional |
pass_threshold |
Whether the search engine or validator marks the PSM as passing its threshold. null when it does not say |
bool, null | optional |
ion_mobility |
Ion mobility value for the precursor ion | float32, null | optional |
ccs |
Collisional cross section in square angstroms (MS:1002954), when the producer reports one | float32, null | no |
mz_array |
Array of m/z values for the spectrum | array[float32], null | optional |
intensity_array |
Array of intensity values for the spectrum | array[float32], null | optional |
charge_array |
Array of fragment ion charge values | array[int32], null | optional |
ion_type_array |
Array of fragment ion type annotations, with any neutral loss (e.g., b1, y2, a2, y5-H2O); the charge is in charge_array |
array[string], null | optional |
ion_mobility_array |
Array of fragment ion mobility values | array[float32], null | optional |
label |
MS1-labelled experiments (SILAC, dimethyl, mTRAQ): the channel label of the identified precursor, whose label modifications peptidoform carries (MS1 labels) |
string, null | optional |
feature_id |
Authoritative (optional) foreign key to the linked Feature row through feature.feature_id; the producer's assignment of this PSM to a consensus feature (null when unlinked). It is NOT recomputable from shared identification fields, so it is materialized. Its inverse, feature.psm_ids, is a computed softlink — Dataset.link_feature_psm() groups (feature_id, psm_id) by feature_id; qpx does not materialize it (bigbio/qpx#267). |
int64, null | optional |
Nullable vs Optional
Core fields marked as "not required" are nullable -- the column always exists in the file but individual values may be null. Optional fields (for example the spectral arrays) may be absent from the file entirely, depending on conversion settings.
Cross-Linking Fields¶
The cross_links field supports XL-MS (cross-linking mass spectrometry) experiments following the mzIdentML 1.3 specification. Each entry in the array represents one cross-link site.
| Field | Description | Type | Required |
|---|---|---|---|
xl_type |
Type of cross-link: "inter" (between two peptides), "intra" (within same peptide), "dead-end" (one reactive end) or "noncovalent" (peptides associated without a link) |
string | yes |
partner_sequence |
Plain amino acid sequence of the beta (partner) peptide. null for dead-end and intra-peptide links |
string, null | no |
partner_peptidoform |
Beta peptide in ProForma notation. null for dead-end and intra-peptide links |
string, null | no |
donor_position |
Cross-link attachment position on the alpha peptide (1-indexed). null for noncovalent associations |
int32, null | no |
acceptor_position |
Attachment position on the beta peptide (1-indexed). null for dead-end links |
int32, null | no |
linker_name |
Name of the cross-linker reagent (e.g., "DSS", "BS3", "DSSO") |
string | yes |
linker_accession |
XLMOD controlled vocabulary accession for the linker (e.g., "XLMOD:02001") |
string, null | no |
linker_mass |
Cross-linker mass in Daltons | float64 | yes |
peptidoform names only the alpha peptide, while calculated_mz and observed_mz belong to the whole complex, so these columns of the PSM state the rest:
| Field | Description | Type |
|---|---|---|
crosslinked_peptidoform |
The linked species in ProForma 2.0, what tells two link species with the same alpha peptide apart: PEPK[XLMOD:02001#XL1]R//SEK[#XL1]R, with the linker's mass where it has no accession, PEP//SEK for a noncovalent pair |
string, null |
protein_starts |
First residue of the alpha peptide in each of protein_accessions (1-indexed): the linked residue is at start + donor_position - 1 |
array[int32], null |
partner_protein_accessions |
Proteins of the partner peptide. protein_accessions holds those of the alpha peptide |
array[string], null |
partner_protein_starts |
First residue of the partner peptide in each of those proteins (1-indexed): the linked residue is at start + acceptor_position - 1 |
array[int32], null |
crosslink_decoy_class |
target_target, target_decoy or decoy_decoy. is_decoy is true for both of the latter |
string, null |
A false-discovery rate at the level of the residue pair or protein pair goes in additional_scores under its own name, next to that of the PSM. One row per residue pair is a query away:
SELECT protein_accessions[1] AS protein_a, partner_protein_accessions[1] AS protein_b,
link.donor_position + protein_starts[1] - 1 AS residue_a,
link.acceptor_position + partner_protein_starts[1] - 1 AS residue_b,
count(*) AS psms
FROM (SELECT *, unnest(cross_links) AS link FROM psm)
WHERE link.xl_type = 'inter' AND crosslink_decoy_class = 'target_target'
GROUP BY ALL
Cross-linked PSM
Non-cross-linked PSMs
For regular (non-XL) PSMs, the cross_links field is null. This keeps the schema clean -- the struct-based design adds no overhead for non-cross-linked datasets.
Shared Fields¶
Several fields in the PSM view use structures shared across other QPX views:
- For details on the
modificationsfield structure, see Modifications. - For details on
additional_scoresand score semantics, see Scores. - For details on
cv_paramsusage and recommended terms, see Scores & CV Terms. - For
additional_scoresandcv_paramsstored byqpxc transform relayoutas a struct with one field per name, see Struct lists.
A null feature_id means no linked feature
feature_id records a PSM's feature link in the exported dataset. A null
value means no link is recorded; it does not establish identification
quality or whether the precursor was quantified.
OpenMS unassigned PeptideIdentifications are retained by default to preserve
identification evidence. Some repeat evidence for a precursor linked through
another spectrum, while others have no detected or mapped feature. Also,
when only the PSM view is exported, all feature_id values are null, even
for identifications assigned to a consensus feature in the source.
When copies of one identification sit in several consensus features (OpenMS
FeatureFinderIdentification on group-merged IDs), feature_id points to the
feature row in the PSM's own run, ranked by same peptidoform and charge, then
closest RT to the precursor, then m/z, consensus quality and feature_id.
The API filters the recorded links:
A psm -> feature join is expected to be partial. When both views are
present, join from psm.with_feature() on feature_id. The conversion option
--no-include-unassigned-psms excludes source unassigned identifications;
it does not populate feature links when the feature view is not exported.
The OpenMS consensus converter omits features without peptide hits.
Example¶
Basic PSM Record¶
{
"psm_id": -4279600662514899531,
"sequence": "AAAAAAAAAAGAAGGR",
"peptidoform": "[UNIMOD:1]-AAAAAAAAAAGAAGGR",
"charge": 2,
"scan": [42164],
"rt": 5140.98,
"calculated_mz": 635.3311,
"observed_mz": 635.3315,
"is_decoy": false,
"posterior_error_probability": 5.58e-20,
"predicted_rt": null,
"run_file_name": "20200101_sample_A",
"protein_accessions": ["Q86U42-2", "Q86U42"],
"modifications": [
{
"name": "Acetyl",
"accession": "UNIMOD:1",
"positions": [
{
"position": 0,
"amino_acid": null,
"scores": []
}
]
}
],
"additional_scores": [
{
"score_name": "andromeda_score",
"score_value": 175.73,
"higher_better": true
},
{
"score_name": "andromeda_delta_score",
"score_value": 160.47,
"higher_better": true
},
{
"score_name": "parent_ion_fraction",
"score_value": 0.0,
"higher_better": true
}
],
"cv_params": [
{"cv_name": "dissociation method", "cv_value": "HCD"},
{"cv_name": "normalized collision energy", "cv_value": "28"}
]
}
PSM with Spectral Data¶
When spectral arrays are included, the record also contains peak-level data:
{
"psm_id": -4279600662514899531,
"sequence": "AAAAAAAAAAGAAGGR",
"peptidoform": "[UNIMOD:1]-AAAAAAAAAAGAAGGR",
"charge": 2,
"scan": [42164],
"rt": 5140.98,
"calculated_mz": 635.3311,
"observed_mz": 635.3315,
"is_decoy": false,
"run_file_name": "20200101_sample_A",
"mz_array": [175.119, 289.163, 360.200, 431.236, 488.258],
"intensity_array": [1234.5, 5678.9, 3456.7, 2345.6, 1234.5],
"charge_array": [1, 1, 1, 1, 1],
"ion_type_array": ["y1", "y2", "b3", "b4", "b5"]
}
File Metadata¶
PSM Parquet files store file-level metadata as key-value pairs in the Parquet footer. The following metadata fields are defined:
| Field | Description |
|---|---|
qpx_version |
Version of the QPX format used to generate the file |
software_provider |
Software that wrote the file (qpx for the qpx writers) |
scan_format |
Format of scan identifiers: scan, index, or nativeId |
creator |
Tool whose output the data was converted from (e.g. maxquant, diann) |
file_type |
Type of the file (value: psm_file) |
creation_date |
Date when the file was created |
compression_format |
Compression algorithm used: zstd (default), snappy, gzip, lzo, or none |
Reading file metadata in Python
Notes¶
DDA-specific view
The PSM view is designed primarily for DDA (data-dependent acquisition) methods. It is not recommended for DIA experiments, where the feature view should be used instead. Generating a PSM file for DIA data would produce duplicated information relative to the feature view.
PEP is a PSM-level metric
posterior_error_probability is defined only in the PSM view. It represents the probability that a specific peptide-spectrum match is incorrect (lower is better). All major tools export PEP as P(incorrect): Percolator (posterior_error_prob), MaxQuant (PEP). FragPipe exports PeptideProphet Probability (P(correct)), so converters must compute PEP = 1 - probability. The feature and peptide views do not carry PEP as a top-level field; use additional_scores or best_id_score if a derived PEP value is needed at those levels.
- Relationship to feature view: The PSM view captures individual spectrum matches, while the Feature View aggregates these into quantified peptide features with intensity data. A single feature may correspond to multiple PSMs across different scans.
- Protein inference: Protein inference results should not be the primary focus of the PSM view.
protein_accessionsis an optional column — protein mappings can be recovered by joining through the feature and protein group views. When included, it is useful for peptide filtering and protein-level browsing. For full protein group information, use the protein group (PG) view. - Spectral arrays:
mz_array,intensity_array,charge_array,ion_type_arrayandion_mobility_arrayare parallel arrays of the same length. Which peaks they hold depends on the producer, so the file's footer keyspectrum_contentstates it:all_peaks(the whole spectrum:qpxc convert mzidentml --include-spectrafrom the MGF),matched_peaks(the peaks the search engine assigned: MaxQuantMasses,Intensities, withMatchesasion_type_arrayandcharge_array), orannotated_peaks(the peaks with a fragment annotation: OpenMS). A file without the key does not say. For large-scale spectral storage, the dedicated mass spectra (mz) view is recommended. - Recommended additional scores:
global_qvalue(experiment-level PSM q-value),rank(peptide rank in search results), andpg_global_qvalue(protein group q-value used for filtering).