-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
103 lines (59 loc) · 3.37 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
output:
github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(echo = TRUE,
collapse = TRUE,
eval = FALSE,
message = TRUE)
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"
annotation_url <- "https://htmlpreview.github.io/?https://github.com/lauzikaite/massFlowR/blob/master/vignettes/annotation.html"
```
# massflowR
[![Build Status](https://travis-ci.org/lauzikaite/massFlowR.svg?branch=master)](https://travis-ci.org/lauzikaite/massFlowR)
Package for pre-processing of high-resolution, untargeted, centroid LC-MS data.
`massFlowR` detects and aligns structurally-related spectral peaks across LC-MS experiment samples.
***
## Individual samples processing
Each LC-MS file in the experiment is processed independently.
* Chromatographic peak detection enabled by the *centWave* algorithm from `xcms` package.
* Grouping structurally-related chromatographic peaks into **pseudo chemical spectra** (PCS).
Individual samples can be processed in real-time during LC-MS spectra acquisition, or in parallel, using backend provided by `doParallel` package.
## Peak alignment
To align chromatographic peaks across all samples in LC-MS experiment, an algorithm, which compares the overall similarity of pseudo chemical spectra is implemented (see [Peak alignment](`r processing_url`)).
## Post-alignment processing
Once pseudo chemical spectra are aligned across samples, the obtained features are validated. Intensity values for each feature in a PCS are correlated across all samples to identify sets of features with similar correlation pattern.
Final step in the pipeline is to re-integrate intensity values for chromatographic peaks that were not detected by the *centWave* using raw LC-MS files. *m/z* and *rt* integration regions are estimated for each sample separetely through cubic smoothing spline interpolation.
In the generated feature table, each feature is assigned to a pseudo chemical spectra, which can be used in manual metabolite annotations.
## Automatic annotation
If in-house chemical reference database is available, obtained PCS are annotated. For more details how to build a database file, see [annotation using database](`r annotation_url`)).
***
## Vignettes
More information is available in vignettes:
* [massFlowR overview](`r massFlowR_url`)
* [Data processing](`r processing_url`)
* [Automatic annotation](`r annotation_url`)
***
# Installation
```{r}
# To install dependencies
install_dependencies <- function () {
dependencies <- c("xcms", "MSnbase", "faahKO", "igraph", "doParallel", "foreach", "ggplot2", "viridis", "gridExtra")
installed <- installed.packages()
to_install <- subset(dependencies, !(dependencies %in% installed[, "Package"]))
if (length(to_install) != 0) {
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
message("Installing packages: ", to_install, " ...")
BiocManager::install(to_install)
} else {
message("All dependencies are already installed.")
}
}
install_dependencies()
# To install development version
devtools::install_github("lauzikaite/massflowR", dependencies = FALSE)
```