About

JSpectraViewer:

Metabolomics, lipidomics, exposomics and natural product (NP) chemistry use a variety of analytical chemistry techniques to detect or identify small molecules. These include nuclear magnetic resonance (NMR) spectroscopy, mass spectrometry (MS), ultraviolet (UV), infrared (IR) and infrared ion (IRIS) spectroscopy. As a result, most of the “raw” data generated for these small- molecule omics research activities is in the form of spectral data. Just like structural data, spectral data needs to be visualized to be understood or interpreted. Unfortunately, most spectral visualization software available today is of the stand-alone, commercial variety. Furthermore, completely different spectral visualization tools must be used to view different types (MS vs. NMR vs. IR vs. IRIS vs. UV) of spectra. Very few freely available, stand-alone or web-based tools exist for spectral visualization or annotation (refs JSpecView, COLMAR, SpeckTackle). Those that do exist are quite limited in their capabilities and are typically designed for viewing a single type of spectral data. This makes it both difficult and expensive to share, exchange or visualize small molecule spectral data. This paucity of spectral visualization tools has been a real hindrance to the field of small molecule omics research as it severely limits the capabilities of metabolomics, lipidomics, exposomics and natural product databases or webservers. JSpectraViewer has been developed as part of the NP-MRD (Natural Products Magnetic Resonance Database) project, enabling the visualization and analysis of various spectral datatypes, including NMR, LC-MS, EI-MS, IR, and UV/Vis spectra. The library has been in use for several years for various web-based applications such as HMDB, GC-AutoFit, and However, a fully repackaged version is now available for public use under the alias "jsv2" (JSpectraViewer version 2) on Node Package Manager (npm).

NP-MRD Project:

The NP-MRD is a freely available cloud-based, user-friendly, FAIR electronic database. NP-MRD accepts NMR data and associated metadata from newly undertaken NP studies. The NP-MRD accepts raw (time domain data, processed spectra, assigned chemical shifts, J-couplings, RDCs, etc.), and meta-data (structures, sources, methods, taxonomy, geospatial data, etc) from natural products ranging from purifiedsubstances to crude extracts, in all major solvents. The NP-MRD includes NPs such as vitamins, minerals, and probiotics aswell as small molecules derived from plants, fungi, bacteria, marine organisms, or animals. The NP-MRD accepts, converts,and stores all major vendor NMR formats and all major NMR data exchange formats from all common NMR experiments as well asnew/uncommon NMR experiments or data sets. The NP-MRD has an intuitive user interface for spectra/structure deposition, retrieval,search, and analysis. Data deposition is fast (less than 5 min/per spectrum), easy and intuitive, and aided by online assignment andonline spectra/structure visualization tools. Structure and assignment validation reports are generated within 5 minutes ofdeposition and value-added data reports are provided to users within 24 hours of deposition, including high-quality DFT calculationsof chemical shifts for a deposited structure. Data integrity and data quality are ensured by extensive curation efforts and theuse of an objective ranking scale for all deposited data.

Supplementary Information:

JSpectraViewer: A web-based spectral visualization tool for small-molecule omics research

Sukanta Saha1,2, Jason Zhai1, Vasuk Gautam1, Harrison Peters1, Jason Grant3, Mark Berjanskii1, Eponine Oler1, Krishna M. Kovur1, Prashanthi Kovur1, David S. Wishart1,2,4,5,6*

1 Department of Biological Sciences, University of Alberta, Edmonton, AB, Canada T6G 2E9

2 Department of Computing Science, University of Alberta, Edmonton, AB, Canada T6G 2E8

3 Department of Agricultural, Food and Nutritional Science, University of Alberta, Edmonton, AB, Canada T6G 2P5

4 Department of Laboratory Medicine and Pathology, University of Alberta, Edmonton, AB, Canada T6G 2B7

5 Faculty of Pharmacy and Pharmaceutical Sciences, University of Alberta, Edmonton, AB, Canada T6G 2H7

6Women and Children’s Health Research Institute, University of Alberta, Edmonton, AB, Canada T6G 1C9

Corresponding author:

Dr. David S. Wishart

Dept. of Biological Sciences

CW-405, Biological Sciences Building

University of Alberta, Edmonton, AB, Canada, T6G 2E9

Telephone: 1-780-492 8574

Email: dwishart@ualberta.ca

Application Programming Interface Modules

S1. SpectraViewers: SpectraViewer1D and SpectraViewer2D are the primary visualization components provided by JSpectraViewer. They can be embedded in an HTML page together with an optional assignment table and 3D molecular viewer. Each component is initialized using a designated container element identified by its HTML id attribute. The components support interactive visualization of NMR, IR, UV–visible, MS, MS/MS, IRIS, and EI–MS spectra. Spectral traces are supplied as paired coordinate and intensity arrays, with configurable normalization, styling, axis conventions, labels, and display ranges. Multiple datasets may be rendered concurrently, including as mirror plots for direct comparison of experimental, reference, predicted, or replicate spectra. The viewers support zooming, panning, view resetting, overview navigation, and export to PNG, SVG, or JPG formats.

Douglas–Peucker line simplification improves the rendering performance of densely sampled spectra while allowing the retained level of detail to be adjusted globally or for individual traces. For NMR applications, SpectraViewer1D can display an assignment table containing peak-to-atom annotations and navigation controls for related NMR multiplets or spectral clusters. These assignments may also be linked to an embedded 3Dmol.js molecular viewer, enabling users to relate observed resonances to specific atoms in the corresponding molecular structure. Optional atom numbering and hydrogen display further support coordinated interpretation of spectra, assignment records, and 3D structures. A montage illustrating the supported spectral types and other components is presented in Figure 1 of the main text.

S2. DataParser: This component provides a standardized mechanism for importing spectral data into JSpectraViewer. It supports commonly used structured formats, including JSON, CSV, and nmrML, and converts heterogeneous source records into a consistent representation that can be used by the SpectraViewer1D and SpectraViewer2D visualization classes. DataParser extracts the numerical coordinates required for visualization. For one-dimensional spectra (any type), these consist of paired horizontal-axis and intensity arrays. For two-dimensional NMR data, an additional array of intensity or surface values is generated. The interpretation of the horizontal coordinate depends on the spectroscopic technique and may represent chemical shift, mass-to-charge ratio, wavenumber, or wavelength.

For assigned NMR records, the parser can additionally extract peak-to-atom assignment information and associated molecular structure data. These outputs allow spectral features to be linked to assignment tables and 3D molecular visualizations. The parsed structure data may include atomic coordinates, atom indices, and bonding information required by the molecular rendering component. The parser supports one- and two-dimensional NMR data, electron ionization and liquid chromatography–mass spectrometry data, infrared spectra, and ultraviolet–visible spectra.

XML-based formats can be interpreted using configurable data tags, while custom parsing functions can be supplied for unsupported or application-specific data structures. Custom parsers are expected to return the same normalized spectrum, assignment, and structure objects used by the standard parsing workflow. Upon successful processing, the component emits a fileParsed browser event. The normalized spectrum coordinates, optional NMR assignments, and molecular structure information are provided through the event payload and can be passed directly to the corresponding JSpectraViewer visualization components. This event-driven design separates file ingestion from rendering and enables applications to attach additional validation, transformation, storage, or interface-update logic to the parsing workflow.

S3. MolSpec: DataParser may not be ideal for retrieving data from other sources, such as databases accessed through REST API routes. MolSpec provides a unified JavaScript interface for retrieving, organizing, and presenting spectroscopic data within applications that use JSpectraViewer. The client application uses the MolSpec microservice bridge to communicate with an external spectral database, such as MolDB (https://moldb.wishartlab.com/). This separation allows the visualization layer to remain independent of the underlying data source while providing a consistent interface for spectrum discovery and display.

MolSpec exposes two primary entry points. The MolSpec.init method retrieves the spectra available for a specified chemical through the application’s proxy endpoint and renders the resulting records as an HTML table. Although a default layout is provided, users may also pass optional HTML elements to render the spectra metadata for a given molecule. Configuration options include an onResults callback for post-retrieval processing, a configurable prefix for spectrum-view links, and a spectraTypes filter that restricts the displayed records to selected analytical techniques.

The MolSpec.initViewer method supports individual spectrum pages. It retrieves the complete spectrum representation in JSON format through the MolSpec bridge, obtains the corresponding compound name from the client application’s local database, and dynamically constructs the principal display sections of the page. These sections include spectrum details, the interactive JSpectraViewer panel, experimental conditions, and bibliographic references.

Table S1. Spectral data formats supported by JSpectraViewer

FormatSpecificationSpectral data typesReadWrite
nmrMLSchober et al. (2018); nmrML v1.0, Metabolomics Standards Initiative (http://nmrml.org)1D NMR, 2D NMR✓✓
mzMLMartens et al. (2011); mzML v1.1.0, HUPO Proteomics Standards Initiative (https://www.psidev.info/mzML)MS, MS/MS, EI-MS✓—
JCAMP-DX (.jdx)McDonald & Wilks (1988) for IR; Davies & Lampen (1993) for NMR; Lampen et al. (1994) for MS; maintained by IUPAC (http://www.jcamp-dx.org)IR, IRIS, UV, MS, MS/MS, EI-MS; NMR✓✓
MGFMascot generic formatMS/MS✓—
XYTwo-column delimited textAll types; any XY plot✓✓
XML (generic)Tag-configurableIR, IRIS, UV✓—
JSONJSV normalized schemaAll types✓✓
CSVComma-delimitedAll types✓✓
TSVTab-delimitedAll types—✓
Vendor formats (Sciex, Thermo Fisher, Agilent, Waters, Bruker)Proprietary; vendor-specific file structuresMS, MS/MS, EI-MS✓—

✓ = supported; — = not supported.

Source Code:

The JSpectraViewer (jsv2) source code is available on GitHub at github.com/JasonZhai-9936/JSV2.

Please cite:

JSpectraViewer: A web-based interactive visualization tool for metabolomics research. Sukanta Saha, Jason Zhai, Vasuk Gautam, Harrison Peters, Jason Grant, Mark Berjanskii, Eponine Oler, Krishna M. Kovur, Prashanthi Kovur, David S. Wishart