26. Spectra¶
Spectra are described by up to three files: a signal file
(spectra_data.parquet), an optional peaks file (spectra_peaks.parquet),
and a set of metadata files described below.
26.1 Signal data disposition¶
When writing signal data, profile data goes in spectra_data.parquet and centroid data goes in
spectra_peaks.parquet, always. When a file contains both for the same spectrum, both files are present.
The spectrum_metadata.parquet row carries both a number_of_data_points (MS:1003060)
and a number_of_peaks (MS:1003059) column so a reader knows which file(s) to
read. Absence of either of these columns implies that that modality does not exist. A reader SHOULD allow the caller to
indicating which representation the it wants.
For timsTOF-style data that is centroid in m/z but profiled in ion mobility, the consensus is to treat it as centroid
for the mass-spectrum dimension and place it in spectra_peaks.parquet. The presence of the metadata column ion_mobility_frame_representation (MS:1003439) SHOULD tell the reader if the ion mobility centroids have been pre-picked or not.
26.2 Spectrum signal data - spectra_data.parquet¶
The spectrum signal data is encoded using either
point layout or
chunked layout. The entity index column MUST
be named spectrum_index, and a co-located time column, if written, SHOULD
be named spectrum_time. Non-mass spectra (UV, DAD) belong in
wavelength_spectra_data.parquet.
When using null marking, follow the null semantics for signal data carefully for profile data.
Profile only
Only profile spectra are written here. Centroid spectra — including
centroid views of profile spectra when both modes are stored — MUST
instead be written to 26.3 spectra_peaks.parquet.
The number of points written here for a spectrum MUST be recorded in the
number_of_data_points (MS:1003060)
column of spectra_metadata.parquet, to support read planning.
26.2.1 Recommended Parquet encodings¶
| Column | Encoding |
|---|---|
spectrum_index |
delta encoding — ideal for repetitive or slowly increasing integers. |
spectrum_time |
byte stream split |
| m/z arrays | byte stream split (byte shuffling), or RLE dictionary when there is ion-mobility data. |
| ion-mobility arrays | RLE dictionary; byte shuffling tends not to help. Consider increasing the dictionary page size. |
| intensity arrays | When stored as integers as some instruments do, byte stream split (byte shuffling) can efficiently reduce size, but shows limited benefit for floating point storage |
When grid encoding is used on any array, byte stream split on the grid indices is usually the best choice.
26.3 Spectrum peak data - spectra_peaks.parquet¶
The spectrum peak lists, stored separately from the raw signal in
spectra_data.parquet. The entity index column MUST be named
spectrum_index, and a co-located time column, if written, SHOULD be named
spectrum_time. Any centroid spectra MUST be written here, not to
spectra_data.parquet. The number of peaks written for a spectrum MUST be
recorded in the
number_of_peaks (MS:1003059) column
of spectra_metadata.parquet, to support read planning.
26.4 Spectrum metadata - spectra_metadata.parquet¶
This table uses the metadata table layout.
index(uint64) — the ascending 0-based index. MUST increment by 1 per entry and SHOULD be written in time-sorted ascending order. This is the primary key for thespectrumfacet and the root unit of addressability.id(string) — the "nativeID" string identifier, formatted per a native identifier format. The specific format SHOULD be given in the file-level metadata underfile_description.source_files[0].parameters, as in mzML.time(float64) — the data-acquisition start time. SHOULD be replicated from the parallelscanfacet for simpler filtering; for a spectrum with multiple scans it SHOULD be the minimum value if the run is in acquisition-time order. The time unit MUST be minutes.ms_level (MS:1000511)(integer) — the MS stage number, ornullfor non-mass spectra.data_processing_id(string) — theidof adata_processingthat governs this spectrum if it deviates from the default inrun.default_data_processing_id;nullotherwise. This applies data processing reflects how properties or attributes of the spectrum are calculated. Data arrays are governed by the data processing methods defined in the array indexparameters(list) — controlled or uncontrolled parameters; see the parameters list.number_of_auxiliary_arrays(integer) — the count of auxiliary arrays in this row'sauxiliary_arrayscolumn; lets a reader cheaply decide whether to decode them.auxiliary_arrays(list) — structures describing arrays that did not fit the arrays-and-columns constraints. These may be large; load eagerly with care.polynomial_delta_coordinate_interpolation(list of float64) — parameters of the m/z delta model used to reconstruct null-marked data. There is no fixed length requirement, and this value MAY benullor empty if no model was learned. Polynomial coefficient terms MUST be written in ascending power, including any zeros.spectrum_representation (MS:1000525)(CURIE) — e.g.MS:1000128"profile spectrum" orMS:1000127"centroid spectrum".scan_polarity (MS:1000465)(integer) —1(positive),-1(negative), ornull.spectrum_type (MS:1000559)(CURIE) — a child of MS:1000559, e.g. MS1 spectrum (MS:1000579), MSn spectrum (MS:1000580).number_of_data_points (MS:1003060)(integer) — profile points stored inspectra_data.parquet.number_of_peaks (MS:1003059)(integer) — discrete peaks stored inspectra_peaks.parquet.- MAY supply a child of
MS:1003058(spectrum property) one or more times — e.g. base peak m/z, total ion current. - MAY supply a child of
MS:1000499(spectrum attribute) one or more times — e.g. spectra_combination (MS:1000570)(CURIE) — how multiple scans were combined to construct this spectrum. MUST be a child term ofMS:1000570|spectra combinationsuch asMS:1000795|no combinationorMS:1000571|sum of spectra. If this column is absent, this value SHOULD be assumed to beMS:1000795|no combination.
26.5 Spectrum scan metadata - spectra_metadata_scans.parquet¶
This table uses the metadata table layout.
A scan or acquisition from the original raw file used to create a spectrum.
source_index(uint64) — theindexof the spectrum this scan belongs to (foreign key).scan_index(uint64) — the ascending 0-based index, incrementing by 1 per entry; uniquely identifies a scan, especially with multiple scans per spectrum (summing/averaging), chained together to form ion mobility frames while preserving the original data.spectrum_reference(string) — another spectrum corresponding to this scan. For local spectra, itsid; for external sources, a USI SHOULD be used. For unpublished collections, useUSI000000as the collection identifier with theidof a source file infile_description.source_files. This might happen when summing and averaging spectra to improve signal quality (e.g. building a consensus spectrum), or when collating spectra across ion mobility measurements into an ion mobility frame.scan_start_time(float64) — The scan start time denotes the time that an analyzer started a scan, relative to the start of the run.instrument_configuration_id(integer) — theinstrument_configurationgoverning this scan referenced byid.parameters(list) — controlled or uncontrolled parameters; see the parameters list.ion_mobility_value(float64) — optional ion-mobility measurement for this scan. If multiple ion mobility values are used and combined on the instrument, such as with a FAIMS compensation voltage ramp, the writer SHOULD record multiplescanrecords perspectrumwith the ramp start and ramp end values in this column, using theMS:1000571|sum of spectracombinator. If multiple ion mobility values are separately acquired per frame, then an ion mobility dimension MUST instead be used in the 26.2 signal data and/or 26.3 peak data.ion_mobility_type(CURIE) — optional; a child ofMS:1002892. Seescan.ion_mobility_valuefor more details on ion mobility ramps.scan_windows(list) — the list of windows in the main axis (m/z array usually) that were acquired in this scan. This SHOULD be an empty list if no window metadata was stored.- (group)
scan_window_lower_limit(MS:1000501) (float32) — The lower m/z bound of a mass spectrometer scan window.scan_window_upper_limit(MS:1000500) (float32) — The upper m/z bound of a mass spectrometer scan window.
position_x(IMS:1000050),position_y(IMS:1000051),position_z(IMS:1000052) (integer) — the pixel position of this scan in an imaging archive. The Imaging profile requiresposition_xandposition_y.- MAY supply children of
MS:1000503(scan attribute),MS:1000018(scan direction, once), andMS:1000019(scan law, once).mass_resolution (MS:1000011)scan_rate (MS:1000015)zoom_scan (MS:1000497)dwell_time (MS:1000502)filter_string (MS:1000512)preset_scan_configuration (MS:1000616)mass_resolving_power (MS:1000800)analyzer_scan_offset (MS:1000803)elution_time (MS:1000826)interchannel_delay (MS:1000880)ion_injection_time (MS:1000927)source_offset_voltage (MS:1001879)first_column_elution_time (MS:1002082)second_column_elution_time (MS:1002083)
26.6 Spectrum precursor metadata - spectra_metadata_precursors.parquet¶
This table uses the metadata table layout.
The method of precursor-ion selection and activation. This table describes the spectrum its source_index references and originates from the
spectrum its precursor_index references. When higher MSn is done, the writer MUST replicate the chain of selected ions from previous MS
levels using the same source_index but each previous MS level's precursor_index. If file does not contain the precursor spectrum, the
precursor_index MUST be null. Precursors SHOULD be stored in descending MS level order.
source_index(uint64) — the spectrum index this precursor belongs to (foreign key).precursor_index(uint64) — the spectrum index of the precursor was created from, the parent spectrum (foreign key). When this spectrum is not present in the current archive, this SHOULD benullprecursor_id(string) — theidof the spectrum referenced byprecursor_index. Ifprecursor_indexisnull, this may still be populated, but a USI SHOULD be used. For unpublished collections, useUSI000000as the collection identifier with theidof a source file infile_description.source_files.isolation_window(group) — the isolation/selection window.parameters(list) — controlled or uncontrolled parameters; see the parameters list.- MUST supply children of
MS:1000792(isolation-window attribute) one or more times; promote to columns when available — e.g. isolation-window target m/z, lower offset, upper offset. isolation_window_target(MS:1000827)isolation_window_lower_offset(MS:1000828)isolation_window_upper_offset(MS:1000829)
activation(group) — the activation/dissociation type and energy.parameters(list) — controlled or uncontrolled parameters; see the parameters list.- MAY supply children of
MS:1000510(precursor activation attribute). collision_energy(MS:1000045)collision_energy_ramp_start(MS:1002013)collision_energy_ramp_end(MS:1002014)supplemental_collision_energy(MS:1002680)normalized_collision_energy(MS:1000138)normalized_collision_energy_ramp_start(MS:1002218)normalized_collision_energy_ramp_end(MS:1002219)activation_energy(MS:1000509)electron_beam_energy(MS:1003410)- MUST supply
MS:1000044(dissociation method) or a child, one or more times.
26.7 Spectrum selected ion metadata - spectra_metadata_selected_ions.parquet¶
{
"name": "spectra_metadata_selected_ions.parquet",
"entity_type": "spectrum",
"data_kind": "selected_ions"
}
This table uses the metadata table layout.
An ion isolated for dissociation. This table follows the same relationship as the 26.6 precursor table.
In addition, there MAY be multiple selected ions from the same precursor selection with co-isolation. If this is
the case, writers SHOULD write the selected_ion_index column to allow unique referencing to each selected ion.
source_index(uint64) — the spectrum this selected ion belongs to (foreign key).precursor_index(uint64) — the spectrum the selected ion was created from (foreign key). This MAY benullwhen the precursor spectrum is not included in the written file.selected_ion_index(uint64) — optional index value unique to this selected ion.ion_mobility_value(float64) /ion_mobility_type(CURIE) — See the 26.5scan.ion_mobility_valuefor details storing scalar values. If multiple ion mobility values are available for the selected ion that have been combined, but no ion mobility centroid is available as when a ramp has been used, report multipleselected_ionrecords, one for the ramp start and one for the ramp end.parameters(list) — controlled or uncontrolled parameters; see the parameters list.- MUST supply a child of
MS:1000455(ion selection attribute) one or more times — e.g. selected-ion m/z, charge state, intensity.
26.8 Spectrum product selection metadata — spectra_metadata_products.parquet¶
This table uses the metadata table layout.
When describing single reaction monitoring (SRM) or multiple reaction monitoring (MRM) experiments, each product ion is isolated separately with a different isolation window. This table is usually empty or absent
source_index(integer) — the spectrum this product belongs to (foreign key).product_index(integer) — the ascending 0-based index, incrementing by 1 per entry. This number uniquely identifies each product ion selection across all rows.isolation_window(group) — the isolation/selection window for this product ion, like the Q3 transmission window on a triple-quadrupole instrument.parameters(list) — controlled or uncontrolled parameters; see the parameters list.- MUST supply children of
MS:1000792(isolation-window attribute) one or more times; promote to columns when available — e.g. isolation-window target m/z, lower offset, upper offset.
parameters(list) — controlled or uncontrolled parameters; see the parameters list.