update_molecule_names {lipidr} | R 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)

[Package lipidr version 2.4.0 Index]