remove_ion_dup: Removes Ion Mode Duplicates

Description Usage Arguments Value Examples

View source: R/ion-mode-functions.R

Description

Removes the ion mode duplicates based on user-modified indices after visual inspection of EIC_plots

Usage

1
remove_ion_dup(Peak.list, Key.list, tbl.id, ...)

Arguments

Peak.list

a data frame containing combined ion mode peaklist with Duplicate IDs. Alternatively can be retrieved from databases. Default is NULL

Key.list

list containing two numeric vectors (one per ionization mode) of ion mode duplicates to keep. Key (vector) corresponding to positive mode duplicates should be first.

tbl.id

character string corresponding to table name to draw from database. Default is NULL

...

Arguments to pass parameters to database functions

Value

NULL testing

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(LUMA)
if(require(lcmsfishdata, quietly = TRUE)) {

  file <- system.file("extdata","EIC_index_pos.txt", package =
  "lcmsfishdata") # is case sensitive on Linux
  EIC_index_pos <- read.table(file, header = TRUE, sep = "\t")
  file2 <- system.file("extdata","EIC_index_neg.txt", package =
  "lcmsfishdata") # is case sensitive on Linux
  EIC_index_neg <- read.table(file2, header = TRUE, sep = "\t")

  Peak.list <- Peaklist_db$Peaklist_Combined_with_Duplicate_IDs

  Key.list <- list(Positive = EIC_index_pos, Negative = EIC_index_neg)

  test <- remove_ion_dup(Peak.list = Peak.list,
                         Key.list = Key.list)
  nrow(Peak.list) - nrow(test) ## Number of ion mode duplicates removed

}

USEPA/LUMA documentation built on Aug. 29, 2020, 1:40 p.m.