Skip to contents

The function orbi_filter_weak_isotopocules() flags isotopocules that are not detected in a minimum of min_percent of scans. This function evaluates weak isotopocules 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_weak_isotopocules(dataset, min_percent)

Arguments

dataset

A simplified IsoX data frame to be processed

min_percent

A number between 0 and 90. Isotopocule must be observed in at least this percentage of scans (please note: the percentage is defined relative to the most commonly observed isotopocule of each compound)

Value

A data frame with new column is_weak_isotopocule that flags weak isotopocules.

Details

The input dataset is expected to have at least these 8 columns: filename, scan.no, time.min, compound, isotopocule, ions.incremental, tic, it.ms.

Examples

fpath <- system.file("extdata", "testfile_flow.isox", package = "isoorbi")
df <- orbi_read_isox(file = fpath) |>
      orbi_simplify_isox() |>
      orbi_flag_weak_isotopocules(min_percent = 2)
#> 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_flag_weak_isotopocules() is flagging isotopocules from data that are
#>    detected in less than 2% of scans in 3 data group(s) (based on 'filename',
#>    'compound')...
#>    ...confirmed there are no weak isotopocules in 0.02 seconds.