View source: R/library_visualizer.R
library_visualizer | R Documentation |
The function plots mass spectra of selected compound in a library
library_visualizer(
input_library,
id = input_library$metadata$ID[1],
type = "complete",
query_spectrum = NULL,
add.legend = T
)
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. |
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.