parse_adduct: Parse adduct

View source: R/parse_adduct.R

parse_adductR Documentation

Parse adduct

Description

This function parses adducts

Usage

parse_adduct(
  adduct_string,
  regex = "\\[(\\d*)M(?![a-z])(\\d*)([+-][\\w\\d].*)?.*\\](\\d*)([+-])?"
)

Arguments

adduct_string

Adduct to be parsed

regex

Regex used for parsing

Value

Parsed elements from adduct

Examples

## Not run: 
parse_adduct("[M+H]+")
parse_adduct("[2M1-C6H12O6 (hexose)+NaCl+H]2+")

## End(Not run)

taxonomicallyinformedannotation/tima-r documentation built on Feb. 28, 2025, 10:10 a.m.