library_visualizer: Visualize selected mass spectra in the spectral library

View source: R/library_visualizer.R

library_visualizerR Documentation

Visualize selected mass spectra in the spectral library

Description

The function plots mass spectra of selected compound in a library

Usage

library_visualizer(
  input_library,
  id = input_library$metadata$ID[1],
  type = "complete",
  query_spectrum = NULL,
  add.legend = T
)

Arguments

input_library

A list generated by the function library_generator() or the name of mgf/msp/RData spectral library file

id

Compound id of the spectra to be plotted (both most recent MS1 and MS2 spectra will be plotted!)

type

Character. "Complete" if raw specra are visualized. "Consensus" if consensus spectra are visualized

query_spectrum

Two-column data matrix. Optional for mirror plot. Two columns represent m/z and intensity of query tandem spectrum.

add.legend

Boolean. If TRUE, figure legend is added.

Examples

data(DRUG_THERMO_LIBRARY)

# Search library using query command lines:
 query = process_query(library2,query=c("IONMODE=Positive"),  rt_search=6, sepString = "@xxx@")
# Visualize the first compound found:
 library_visualizer(query$SELECTED, id = "1")

# Plot against query spectrum:
query_spectrum = cbind(c(71.084, 89.6, 455.178), c(90,40,39))
library_visualizer(library2, id = "1", query_spectrum,  type = "complete") 


daniellyz/MergeION2 documentation built on Jan. 26, 2024, 6:24 a.m.