Skip to contents

This function updates the sample_info and sample_info_note slots of a mass_dataset object. It ensures that the columns in sample_info are consistent with the names in sample_info_note.

Usage

update_sample_info(object)

Arguments

object

A mass_dataset object whose sample_info and sample_info_note slots you want to update.

Value

A mass_dataset object with updated sample_info and sample_info_note slots.

Author

Xiaotao Shen xiaotao.shen@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
)
updated_md <- update_sample_info(object)
head(extract_sample_info(updated_md))
#>   sample_id injection.order   class   group
#> 1   Blank_3               1   Blank   Blank
#> 2   Blank_4               2   Blank   Blank
#> 3      QC_1               3      QC      QC
#> 4      QC_2               4      QC      QC
#> 5     PS4P1               5 Subject Subject
#> 6     PS4P2               6 Subject Subject
head(extract_sample_info_note(updated_md))
#>              name         meaning
#> 1       sample_id       sample_id
#> 2 injection.order injection.order
#> 3           class           class
#> 4           group           group