reduce: Reduce an _m/z_ features by removing isotopic, adduct or...

reduceR Documentation

Reduce an m/z features by removing isotopic, adduct or unknown features

Description

Reduce m/z features in an analysis that includes putative molecular formula assignments by removing isotopic, adduct or unknown features.

Usage

reduce(
  x,
  isotopes = TRUE,
  adducts = TRUE,
  unknowns = FALSE,
  isotopic_adducts = c("[M+Cl37]1-", "[M+K41]1+")
)

## S4 method for signature 'Analysis'
reduce(
  x,
  isotopes = TRUE,
  adducts = TRUE,
  unknowns = FALSE,
  isotopic_adducts = c("[M+Cl37]1-", "[M+K41]1+")
)

## S4 method for signature 'AnalysisData'
reduce(
  x,
  isotopes = TRUE,
  adducts = TRUE,
  unknowns = FALSE,
  isotopic_adducts = c("[M+Cl37]1-", "[M+K41]1+")
)

Arguments

x

an object of S4 class Analysis or AnalysisData

isotopes

TRUE/FALSE remove isotopic features.

adducts

TRUE/FALSE remove features that are multiple adducts of the same molecular formula. The adduct with the highest intensity is retained for each assigned molecular formula.

unknowns

TRUE/FALSE remove unaOssigned m/z features.

isotopic_adducts

a vector of additional isotopic adducts to remove if argument isotopes = TRUE

Details

If argument isotopes = TRUE, all isotopic features are removed. If argument adducts = TRUE, the feature with the maximum intensity for each molecular formula is retained.

Value

An object of S4 class Analysis or AnalysisData with reduced m/z features.

Examples

## Assign molecular formulas
p <- assignments::assignmentParameters('FIE')

assignment <- assignments::assignMFs(assignments::feature_data,p)

## Retrieve assigned data
assigned_data <- metabolyseR::analysisData(
 assignments::assignedData(assignment),
 tibble::tibble(sample = seq_len(nrow(assignments::feature_data)))
 )

reduced_data <- metaboMisc::reduce(assigned_data)

reduced_data

jasenfinch/metaboMisc documentation built on July 31, 2023, 2:28 a.m.