Description Usage Arguments Value Examples
View source: R/trimming-functions.R
Searches features or compounds in Peak.list that are present in process blanks and removes them. Also flags compounds as exogenous, defined as mean abundance in endogenous samples below user-defined threshold.
1 2 3 4 5 6 7 8 9 10 11 12 13 | remove_background_peaks(
Peak.list = NULL,
Sample.df,
search.par,
method,
lib.db,
tbl.id,
db.list,
db.dir,
new.db,
mem,
...
)
|
Peak.list |
a named list of data frames (two per ionization mode) containing intensity matrices across all study samples and Pooled QCs and process blanks. Names should be c('pos','neg','blanks_pos','blanks_neg'). Alternatively may use existing database connections by setting to NULL |
Sample.df |
a data frame with class info as columns, containing a separate row entry for each unique sex/class combination. Must contain the columns 'Sex','Class','n','Endogenous'. |
search.par |
a single-row data frame with 11 variables containing
user-defined search parameters. Must contain the columns
|
method |
which method to apply to search for background components. See
|
lib.db |
character name of database to contain Solvent Library |
tbl.id |
character vector of table names to draw from databases. First
value should be table name from peak database, second should be table name
from solvent database. Default is |
db.list |
list chracter names of databases containing results from
processing positive mode (1,3) and negative mode (2,4) data for samples
(1,2) and blanks (3,4) Default is |
db.dir |
character directory containing the databases Default is
|
new.db |
character what should the new database be called Default is
|
mem |
logical should database be in-memory. Default is |
... |
Arguments to pass parameters to find_Background |
nested list a list for each ionization mode, each containing a list of two dataframes: the first contains the intensity matrix for the peaklist with solvent peaks removed, the second contains the intensity matrix for the solvent peaks
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 | library(LUMA)
if(require(lcmsfishdata, quietly = TRUE)) {
file <- system.file('extdata','Sample_Class.txt', package = "LUMA") # is case
# sensitive on Linux
Sample.df <- read.table(file, header = TRUE, sep = "\t")
# is case sensitive on Linux
file2 <- system.file('extdata','Search_Parameters.txt', package = "LUMA")
search.par <- read.table(file2, header = TRUE, sep = "\t")
#From m/z features
Peak.list <- list(pos = lcmsfishdata::Peaklist_Pos$From_CAMERA, neg =
lcmsfishdata::Peaklist_Neg$From_CAMERA, blanks_pos =
lcmsfishdata::Blanks_Pos$From_CAMERA, blanks_neg =
lcmsfishdata::Blanks_Neg$From_CAMERA)
test <- remove_background_peaks(Peak.list = Peak.list, Sample.df =
Sample.df, search.par = search.par, method = "mz", mem = TRUE)
lapply(test, head) #Peaklists with removed background components are returned
#From combined features
Peak.list <- list(pos = lcmsfishdata::Peaklist_Pos$Trimmed_by_MinFrac, neg =
lcmsfishdata::Peaklist_Neg$Trimmed_by_MinFrac, blanks_pos =
lcmsfishdata::Blanks_Pos$Combined_Isotopes_and_Adducts, blanks_neg =
lcmsfishdata::Blanks_Neg$Combined_Isotopes_and_Adducts)
test <- remove_background_peaks(Peak.list = Peak.list, Sample.df = Sample.df,
search.par = search.par, method = "monoMass", mem = TRUE)
lapply(test, head) #Peaklists with removed background components are returned
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.