BiocStyle::markdown()
Package: r Githubpkg("ebruginski/ChromR")
Author: Estevan Bruginski
e-mail: estevan.bruginski@ufpr.br
Modified: r file.info("Planning-with-ChromR.Rmd")$mtime
Compiled: r date()
The r Githubpkg("ebruginski/ChromR")
package brings some functions to help analysts, Ph.D. students and technicians to plan and organize LC analyses. The functions are separated into 2 main sections, Pre-analysis and Post-analysis. In Pre-analyse, the functions will help to randomize the injections order, calculation of the quantity of mobile phase and the spent time of batches. The Post-analyse functions will help to organize the obtained files according to their respective batches or classes, avoiding human error.
library(ChromR)
The FileOrganizer
function is used to create folders and to move MS files to their respective batch or class folders. This function uses metadata generated from sample list.
First, we need to generate a .csv file, this file needs to have the following column names: Samples, Class, Order, and Batch, this will be the standard .csv metadata layout for all functions in the r Githubpkg("ebruginski/ChromR")
package.
library(kableExtra) metadata_ex <- read.csv("D:/My_projects/ChromR/data-raw/metadata-ex.csv", header = T)
kable(metadata_ex, caption = "Example of metadata layout",align = "c", format = "html") %>% kable_styling( bootstrap_options = "responsive", full_width = F, position = "left")
Example 1: How to use the FileOrganizer
function to sort the MS files by batch.
## Load the package library(ChromR) ## Set the path to where are the MS files setwd("D:/My_projects/ChromR/data/") ## Set the path to metadata.csv metadata <- "D:/My_projects/ChromR/data/metadata.csv" ## Organize the files into batch folders FileOrganizer(metadata, filetype = ".mzML", by = "Batch", remove = FALSE)
message('All files have been moved to their respective folders.')
Example 2: How to use the FileOrganizer
function to sort the MS files by class.
## Load the package library(ChromR) ## Set the path to where are the MS files setwd("D:/My_projects/ChromR/data/") ## Set the path to metadata.csv metadata <- "D:/My_projects/ChromR/data/metadata.csv" ## Organize the files into class folders FileOrganizer(metadata, filetype = ".mzML", by = "Class", remove = FALSE)
message('All files have been moved to their respective folders.')
The argument filetype
can be modified to any kind of file pattern like ".mzXML", ".netCDF", ".CDF", ".raw", ".mgf", ".txt", etc.; according to the file extension that you want to sort.
To save space on the hard disk we can set the remove = TRUE
, this option will remove the files from the original folder. After that, we can use packages like r Githubpkg("xia-lab/MetaboAnalystR")
and r Biocpkg("xcms")
to perform the pre-processing steps of LC-MS raw data. These packages use the information of the subfolders to build the groups/classes to perform the statistical analysis.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.