
Convert mass_dataset to SummarizedExperiment Object
Source:R/convert_mass_dataset2summarizedexperiment.R
convert_mass_dataset2summarizedexperiment.RdThis function converts a mass_dataset object to a SummarizedExperiment object.
It extracts the sample_info, variable_info, and expression_data from the mass_dataset object
and constructs a new SummarizedExperiment object.
Details
The function checks if the input object is of class mass_dataset. If it is, it extracts the sample_info,
variable_info, and expression_data and uses these to create a new SummarizedExperiment object.
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
)
se <- convert_mass_dataset2summarizedexperiment(object)
se
#> class: SummarizedExperiment
#> dim: 1000 8
#> metadata(0):
#> assays(1): counts
#> rownames(1000): M136T55_2_POS M79T35_POS ... M232T937_POS M301T277_POS
#> rowData names(3): variable_id mz rt
#> colnames(8): Blank_3 Blank_4 ... PS4P3 PS4P4
#> colData names(4): sample_id injection.order class group