update_molecule_names: Rename molecules in a dataset.

View source: R/manip.R

update_molecule_namesR Documentation

Rename molecules in a dataset.

Description

This function enables users to rename selected molecules in the dataset, so that they can be parsed correctly by lipidr or modify the lipid class. lipidr automatically updates the annotation for the renamed molecules.

Usage

update_molecule_names(data, old, new)

Arguments

data

LipidomicsExperiment object.

old

A character vector of the molecule names to be renamed.

new

A character vector of the new molecule names.

Value

A LipidomicsExperiment object with molecules name and annotation updated.

Examples

data(data_normalized)
old_names <- rowData(data_normalized)$Molecule
# replace PCO with plasmenylPC
new_names <- sub("^LPE", "LysoPE", old_names)
update_molecule_names(data_normalized, old_names, new_names)

ahmohamed/lipidr documentation built on July 7, 2023, 2:22 a.m.