Skip to content

mwang87/MetabolomicsSpectrumResolver

Repository files navigation

USI Resolver and Displayer for Metabolomics

This tool is meant to be able to show USIs from various sources. It will achieve the following goals:

  1. Enable creation of embeddable images in publications that will link out to viewable/interactable spectrum plots.
  2. 3rd party embedding for visualization of spectra that exist in repositories (e.g. MassIVE, PRIDE, PeptideAtlas).
  3. 3rd party embedding of QR code.

Supported USI Types:

  1. GNPS Molecular Networking Clustered Spectra
  2. GNPS Spectral Libraries
  3. ProteoXchange Repository Data
  4. MS2LDA Reference Motifs
  5. MassBank Library Spectra
  6. MetaboLights Dataset Spectra
  7. Metabolomics Workbench Dataset Spectra

unittest loadtest DOI

⚠️ These identifiers are based on draft USI and draft Metabolomics USI identifiers. Thus, they are subject to change, and so for the moment, they will be specified as mzdraft instead of mzspec in the first block. Thank you for your patience and working with us!

Example USI URLs

MS2LDA

mzspec:MS2LDA:TASK-190:accession:43062

MOTIFDB

mzspec:MOTIFDB::accession:171163

GNPS Task Spectra for file

mzspec:GNPS:TASK-c95481f0c53d42e78a61bf899e9f9adb-spectra/specs_ms.mgf:scan:1943

GNPS Task Spectra for collection

mzspec:GNPS:TASK-c95481f0c53d42e78a61bf899e9f9adb-spectra:scan:1943

MassIVE Task Spectra for file

mzspec:MassIVE:TASK-c95481f0c53d42e78a61bf899e9f9adb-spectra/specs_ms.mgf:scan:1943

MassIVE Task Spectra for collection

mzspec:MassIVE:TASK-c95481f0c53d42e78a61bf899e9f9adb-spectra:scan:1943

GNPS Library Spectra

mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00005436077

MassBank Library Spectra

mzspec:MASSBANK::accession:SM858102

ProteomeXchange Repository Data

mzspec:PXD000561:Adult_Frontalcortex_bRP_Elite_85_f09:scan:17555

MassIVE/GNPS Repository Data

mzspec:MSV000079514:Adult_Frontalcortex_bRP_Elite_85_f09:scan:17555

mzspec:MSV000078547:120228_nbut_3610_it_it_take2:scan:389

MassIVE/GNPS MS1 Spectra

mzspec:MSV000085444:Hui_N3_fe:scan:500

MetaboLights Repository Data

mzspec:MSV000082791:(-)-epigallocatechin:scan:2

Metabolomics Workbench Repository Data

mzspec:MSV000082680:iPSC-T1R1:scan:3

USI Extended for Metabolomics - Formatting Documentation

Massbank Library Spectrum

mzspec:MASSBANK::accession:<MassBank Accession>

GNPS Analysis Task Spectrum

mzspec:GNPS:TASK-<GNPS Task ID>-<File name in task>:scan:<scan number>

MS2LDA MOTIFDB

mzspec:MOTIFDB::accession:<Motif DB accession>

GNPS Library Spectrum

mzspec:GNPS:<GNPS library name (ignored)>:accession:<GNPS Library Accession>

Metabolights Data Repository Spectrum

mzspec:<MetaboLights MSV identifier>:<Filename>:scan:<Scan Number>

Metabolomics Workbench Data Repository Spectrum

mzspec:<Metabolomics Workbench MSV identifier>:<Filename>:scan:<Scan Number>

MassIVE/GNPS Data Repository Spectrum

See Proteomics USI Standard

Example Formatting Figures

Vanilla Rendering

Small Figure

Mass Range Filtering

Zoom Intensity

No Grid

No Peak Annotations

Custom Peak Annotations

Less Decimal Places

Rotate Labels

Decrease Label Minimum Intensity

Vanilla Mirror Match

Mirror Match with Intensity Scaling

Custom Title

Plotting Parameters

  • mz_min: Minimum m/z value.
  • mz_max: Maximum m/z value.
  • annotate_peaks: Defines which peaks in which spectrum (top or bottom) will be annotated. The parameters is a list of lists of m/z values of the peaks to be annotated. For a single spectrum plot it should be a single nested list (i.e. [[m1, m2]]), for a mirror plot it should be two nested lists for the top spectrum and the bottom spectrum (i.e. [[s1m1,s1m2],[s2m1,s2m2]]).
  • plot_title: Custom plot title, omit to use default

URL Endpoints

  1. /png/
  2. /svg/
  3. /json/
  4. /proxi/v0.1/spectra
  5. /csv/
  6. /qrcode/
  7. /spectrum/
  8. /mirror/
  9. /svg/mirror
  10. /png/mirror

Development

Unit Testing

To run unit tests

export PYTHONPATH=${PYTHONPATH}:.
pytest -v -n 4 ./test/