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:

Building database

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.

Building database table

Function buildDB can be used to build a database table from rda files. The generated table will have the following columns:

# 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")

Automatic annotation

To annotate a features table, you will need:

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)

See also

unlink(list.files(path = out_directory, pattern = ".csv", full.names = TRUE))
unlink(list.files(path = out_directory, pattern = ".RDS", full.names = TRUE))


lauzikaite/massFlowR documentation built on April 29, 2020, 9:45 a.m.