knitr::opts_chunk$set( collapse = TRUE, comment = "#>", out.width = "100%" )
library(massdataset) library(tidyverse) library(metid) ms1_data = readr::read_csv(file.path( system.file("ms1_peak", package = "metid"), "ms1.peak.table.csv" )) ms1_data = data.frame(ms1_data, sample1 = 1, sample2 = 2) expression_data = ms1_data %>% dplyr::select(-c(name:rt)) variable_info = ms1_data %>% dplyr::select(name:rt) %>% dplyr::rename(variable_id = name) sample_info = data.frame( sample_id = colnames(expression_data), injection.order = c(1, 2), class = c("Subject", "Subject"), group = c("Subject", "Subject") ) rownames(expression_data) = variable_info$variable_id object = create_mass_dataset( expression_data = expression_data, sample_info = sample_info, variable_info = variable_info ) object
mass_dataset
objectpath = "./example" dir.create(path) ms2_data <- system.file("ms2_data", package = "metid") file.copy( from = file.path(ms2_data, "QC1_MSMS_NCE25.mgf"), to = path, overwrite = TRUE, recursive = TRUE ) object = massdataset::mutate_ms2( object = object, column = "rp", polarity = "positive", ms1.ms2.match.mz.tol = 10, ms1.ms2.match.rt.tol = 30 ) object object@ms2_data
data("snyder_database_rplc0.0.3", package = "metid") object1 = annotate_metabolites_mass_dataset(object = object, database = snyder_database_rplc0.0.3) head(object1@annotation_table) head(extract_variable_info(object = object1))
ms2_plot_mass_dataset(object = object1, variable_index = 1, database = snyder_database_rplc0.0.3)
ms2_plot_mass_dataset(object = object1, variable_index = 3, database = snyder_database_rplc0.0.3)
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.