Skip to content

Commit

Permalink
update documentation for mzmlstastistics
Browse files Browse the repository at this point in the history
  • Loading branch information
ypriverol committed Mar 10, 2025
1 parent 8b0054e commit e8227a4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@ quantms-utils have multiple scripts to generate mzML stats. These files are used
- `scan`: The scan accession for each MS and MS/MS signal in the mzML, depending on the manufacturer, the scan will have different formats. Example, for thermo (e.g `controllerType=0 controllerNumber=1 scan=43920`). We tried to find the definition of [quantms.io](https://github.com/bigbio/quantms.io/blob/main/docs/README.adoc#scan).
- `ms_level`: The MS level of the signal, 1 for MS and 2 for MS/MS.
- `num_peaks`: The number of peaks in the MS. Compute with pyopenms with `spectrum.get_peaks()`.
- `base_peak_intensity`: The max intensity in the spectrum (MS or MS/MS).
- `summed_peak_intensities`: The sum of all intensities in the spectrum (MS or MS/MS).
- `rt`: The retention time of the spectrum, capture with pyopenms with `spectrum.getRT()`.

For MS/MS signals, we have the following additional columns:

- `precursor_charge`: The charge of the precursor ion, if the signal is MS/MS. Capture with pyopenms with `spectrum.getPrecursors()[0].getCharge()`.
- `precursor_mz`: The m/z of the precursor ion, if the signal is MS/MS. Capture with pyopenms with `spectrum.getPrecursors()[0].getMZ()`.
- `precursor_intensity`: The intensity of the precursor ion, if the signal is MS/MS. Capture with pyopenms with `spectrum.getPrecursors()[0].getIntensity()`. If the precursor is not annotated (present), we use the purity object to get the information; see note below.
- `precursor_rt`: The retention time of the precursor ion, if the signal is MS/MS. See note below.
- `precursor_total_intensity`: The total intensity of the precursor ion, if the signal is MS/MS. See note below.

> [!NOTE]
> For all the precursor-related information, we are using the first precursor in the spectrum. The following columns `intensity` (if not annotated), `precursor_rt`, and `precursor_total_intensity` we use the following pyopnems code:
> ```python
> precursor_spectrum = mzml_exp.getSpectrum(precursor_spectrum_index)
> precursor_rt = precursor_spectrum.getRT()
> purity = oms.PrecursorPurity().computePrecursorPurity(precursor_spectrum, precursor, 100, True)
> precursor_intensity = purity.target_intensity
> total_intensity = purity.total_intensity
> ```
</details>
Expand Down
1 change: 0 additions & 1 deletion quantmsutils/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
NUM_PEAKS = "num_peaks" # number of peaks in the spectrum (MS1 or MS2)
BASE_PEAK_INTENSITY = "base_peak_intensity"
SUMMED_PEAK_INTENSITY = "summed_peak_intensities"
MAX_INTENSITY = "max_intensity"
RETENTION_TIME = "rt"
CHARGE = "precursor_charge" # charge of the precursor ion
INTENSITY = "precursor_intensity"
Expand Down

0 comments on commit e8227a4

Please sign in to comment.