Learn R Programming

ume (version 1.5.2)

as_peaklist: Check format of peaklist

Description

Flexible entry point for UME. Accepts:

  • data.frame / data.table peaklists

  • numeric m/z vectors

  • file paths (csv, txt, tsv, rds)

Normalizes column names, adds missing structural columns (file_id, peak_id), removes invalid rows, validates schema, and assigns the UME peaklist class. Creates a standardized data.table ready for formula assignment.

Usage

as_peaklist(pl, verbose = FALSE, track_original_names = TRUE, ...)

Value

A validated and normalized peaklist as a data.table

with class "ume_peaklist".

Arguments

pl

Input object representing a peaklist. Can be:

  • data.frame or data.table

  • file path to a supported tabular format

  • numeric vector of m/z values

verbose

logical; if TRUE, show progress messages.

track_original_names

Logical (default: TRUE). If TRUE, as_peaklist() stores a "original_colnames" attribute mapping canonical UME names (e.g. "mz") to the user’s original column names (e.g. "m/z"). Internal functions that perform many := operations (e.g. assign_formulas()) may set this to FALSE to avoid attribute- related shallow-copy warnings.

...

Reserved for future extensions.

See Also

Other check ume objects: check_formula_library(), check_mfd()