Skip to contents

Calculate the exact mass for a lipid given its abbreviation and ion type.

Usage

calculate_exact_mass(client, lipid_abbrev, ion_type)

Arguments

client

An mw_rest_client object

lipid_abbrev

A character string representing the lipid abbreviation (e.g., "PC(34:1)", , "PE(36:2)").

ion_type

A character string representing the ion type (e.g., "M+H", "M-H", "M+Na").

Value

A tibble containing the parsed data, with calculated exact mass:

lipid_abbrev

The lipid abbreviation (e.g., "PC(34:1)")

ion_type

The ion type (e.g., "M+H+")

lipid_name

The full lipid name (e.g., "PC 34:1")

ion_type_parsed

The parsed ion type (e.g., "M+H+")

mz

The m/z value (numeric, e.g., 760.585077)

formula

The molecular formula (e.g., "C42H83NO8P")

Examples

if (FALSE) { # \dontrun{
client <- mw_rest_client()

# Calculate exact mass for phosphatidylcholine
mass_info <- calculate_exact_mass(client, "PC(34:1)", "M+H")
print(mass_info$exactmass)

# Calculate for different ion types
mass_na <- calculate_exact_mass(client, "PC(34:1)", "M+Na")
} # }