orbi_flag_outliers {isoorbi} | R Documentation |
Flag outlier scans
Description
The function orbi_flag_outliers()
flags outliers using one of the different methods provided by the parameters (to use multiple, please call this function several times sequentially). Note that this function evaluates outliers within each "filename", "block", "segment" and "injection" (if these columns exist), in addition to any groupings already defined before calling this function using dplyr's group_by()
. It restores the original groupings in the returned data frame.
Usage
orbi_flag_outliers(dataset, agc_fold_cutoff = NA_real_, agc_window = c())
Arguments
dataset |
Simplified IsoX dataset to have outliers flagged |
agc_fold_cutoff |
flags scans with a fold cutoff based on the average number of ions in the Orbitrap analyzer. For example, |
agc_window |
flags scans with a critically low or high number of ions in the Orbitrap analyzer. Provide a vector with 2 numbers |
Details
Function is intended to flag scans that are outliers.
The input dataset
is expected to have at least these 8 columns: filename
, scan.no
, time.min
, compound
, isotopocule
, ions.incremental
, tic
, it.ms
.
Value
A data frame with new columns is_outlier
and outlier_type
(if they don't already exist) that flags outliers identified by the method and provides the type of outlier (e.g. "2 fold agc cutoff"), respectively.
Examples
fpath <- system.file("extdata", "testfile_flow.isox", package = "isoorbi")
df <-
orbi_read_isox(file = fpath) |>
orbi_simplify_isox() |>
orbi_flag_outliers(agc_window = c(1,99))