update_mass_dataset: Update a mass_dataset Object

View source: R/update_mass_dataset.R

update_mass_datasetR Documentation

Update a mass_dataset Object

Description

This function updates the slots of a mass_dataset object to ensure consistency among sample_info, variable_info, and expression_data. It also logs the update process.

Usage

update_mass_dataset(object)

Arguments

object

A mass_dataset object that you want to update.

Value

A mass_dataset object with updated slots and process information.

Author(s)

Xiaotao Shen shenxt1990@outlook.com

Examples

data("expression_data")
data("sample_info")
data("variable_info")

object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info,
  )

object

####only remain QC samples
sample_info = extract_sample_info(object = object)

sample_info =
  dplyr::filter(sample_info, class == "QC")

object@sample_info = sample_info

object = update_mass_dataset(object = object)
object

####only remain feature with mz < 300
variable_info = extract_variable_info(object = object)

variable_info =
  dplyr::filter(variable_info, mz < 300)

object@variable_info = variable_info

object = update_mass_dataset(object = object)
object

tidymass/massdataset documentation built on Sept. 14, 2024, 4:41 p.m.