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")
  )
#> orbi_read_isox() is loading .isox data from 1 file(s)...
#> - loaded 6449 peaks for 1 compounds (HSO4-) with 5 isotopocules (M0, 33S,
#>    17O, 34S, 18O) from testfile_flow.isox in 0.02 seconds.
#> orbi_simplify_isox() will keep only columns 'filepath', 'filename',
#>    'scan.no', 'time.min', 'compound', 'isotopocule', 'ions.incremental',
#>    'tic', 'it.ms'...
#>    ...complete in 0.00 seconds.
#> orbi_filter_isox() is filtering the dataset by filenames (s3744), compounds
#>    (HSO4-), isotopocules (M0, 34S, 18O)...
#>    ...removed 5159/6449 rows (80.0%) in 0.00 seconds.