Package: massFlowR
Authors: Elzbieta Lauzikaite
Date: r date()
BiocStyle::markdown() knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) Biocpkg <- function (pkg) { sprintf("[%s](http://bioconductor.org/packages/%s)", pkg, pkg) } options(kpb.suppress_noninteractive = TRUE) ## supressing progress bar
suppressWarnings(library(massFlowR)) db_file <- "../inst/testdata/database.csv" ds_file <- "../inst/testdata/filled_intensity_data.csv" meta_file <- "../inst/testdata/metadata.csv" out_directory <- getwd() massFlowR_url <- "https://htmlpreview.github.io/?https://github.com/lauzikaite/massFlowR/blob/master/vignettes/massFlowR.html" processing_url <- "https://htmlpreview.github.io/?https://github.com/lauzikaite/massFlowR/blob/master/vignettes/processing.html"
massFlowR performs automatic annotation of final feature table if LC-MS files for chemical reference compounds are available. Database table can be obtained from raw LC-MS files in two steps:
Raw LC-MS files acquired for each chemical standards were processed by the National Phenome Centre. Each chemical standard was written as an rda file. Code for corresponding functionality will be added to massFlowR package for those that have acquired LC-MS data independently.
Function buildDB can be used to build a database table from rda files. The generated table will have the following columns:
peakid (unique peak number)mz (peak m/z)rt (peak retention time, sec)into (peak intensity)peakgr (unique peak-group number)chemid (unique database chemical number)dbid (compound identifier)dbname (compound chemical name)# rda_dir <- "path to rda files" # out_directory <- "path to output directory" buildDB(rda_dir = rda_dir, out_dir = out_directory) db_table <- read.csv(file.path(out_directory, "database.csv"))
db_table <- read.csv(db_file) db_table <- db_table[which(db_table$chemid %in% c(1,2,3)),] kableExtra::kable_styling( knitr::kable(x = db_table, format = "html", row.names = F), full_width = TRUE, bootstrap_options = c("striped"), position = "left")
To annotate a features table, you will need:
fillPEAKS function. Sample names in this table must correspond to 'filename' column in metadata.First, massFlowAnno class object is created by buildANNO function.
# meta_file <- "path to metadata csv file" # ds_file <- "path to filled intensity data csv file" # out_directory <- "path to output directory" anno <- buildANNO(ds_file = ds_file, meta_file = meta_file, out_dir = out_directory)
massFlowAnno class object can be annotated with different databases tables using function annotateDS.
anno <- annotateDS(object = anno, db_file = db_file, out_dir = out_directory, mz_err = 0.01, rt_err = 10, ncores = 2)
unlink(list.files(path = out_directory, pattern = ".csv", full.names = TRUE)) unlink(list.files(path = out_directory, pattern = ".RDS", full.names = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.