update_molecule_names: Rename molecules in a dataset.

Description Usage Arguments Value Examples

View source: R/manip.R

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

1

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

1
2
3
4
5
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)

lipidr documentation built on Nov. 8, 2020, 7:50 p.m.