Skip to contents

A basic filter function orbi_filter_isox() for file names, isotopocules, compounds and time ranges. Default value for all parameters is NULL, i.e. no filter is applied.

Usage

orbi_filter_isox(
  dataset,
  filenames = NULL,
  compounds = NULL,
  isotopocules = NULL,
  time_min = NULL,
  time_max = NULL
)

Arguments

dataset

The IsoX data to be filtered

filenames

Vector of file names to keep, keeps all if set to NULL (the default)

compounds

Vector of compounds to keep, keeps all if set to NULL (the default)

isotopocules

Vector of isotopocules to keep, keeps all if set to NULL (the default)

time_min

Minimum retention time in minutes (time.min), no minimum if set to NULL (the default)

time_max

Maximum retention time in minutes (time.min), no maximum if set to NULL (the default)

Value

Filtered tibble

Examples

fpath <- system.file("extdata", "testfile_flow.isox", package = "isoorbi")
df <-
  orbi_read_isox(file = fpath) |>
  orbi_simplify_isox() |>
  orbi_filter_isox(
    filenames = c("s3744"),
    compounds = "HSO4-",
    isotopocules = c("M0", "34S", "18O")
  )
#>  [20ms] orbi_read_isox() loaded 6449 peaks for 1 compound (HSO4-) with 5
#> isotopocules (M0, 33S, 17O, 34S, and 18O) from testfile_flow.isox
#>  [57ms] orbi_read_isox() read .isox data from 1 file
#>  [5ms] orbi_simplify_isox() kept columns filepath, filename, scan.no,
#> time.min, compound, isotopocule, ions.incremental, tic, and it.ms
#>  [11ms] orbi_filter_isox() filtered the dataset by filenames (s3744),
#> compounds (HSO4-), and isotopocules (M0, 34S, 18O) and removed a total of
#> 5159/6449 rows (80.0%)