This function construct a SummarizedExperiment object for analysis. by input data frames.
as_summarized_experiment(
abundance,
goslin_annotation,
group_info = NULL,
se_type = c("profiling", "de_two", "de_multiple", "ml", "corr"),
paired_sample = FALSE
)
A data frame of predictors includes features (such as molecules or lipid classes) and their abundance in each sample. NAs are allowed in all columns except the first. The first column must be named "feature" and contain names of unique lipid species.
A data frame of lipid characteristics from the
parseLipidNames
function of rgoslin package.
Please exclude lipids with the "Grammar" column marked as 'NOT_PARSEABLE'.
A data frame containing group information. The required columns are listed as below.
sample_name: name of each sample. NAs are not allowed; the sample names must be unique and match those in the abundance data.
label_name: label name of each sample. NAs are not allowed.
group: group name of each sample. NAs are not allowed.
pair: (only required for two-group data) If paired samples are contained, they should be sequentially numbered from 1 to N without missing, blank, or skipped numbers. If not, the values must all be marked as NA.
Character. The SummarizedExperiment object is generated for running functions related to which analysis type. Must by one of "profiling", "de_two", "de_multiple", "ml", or "corr".
Logical/NULL. For two-group data, enter TRUE/FALSE to indicate if paired samples are included. For multi-group data, enter NULL.
Return a SummarizedExperiment object.
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
data("abundance_twoGroup")
data("group_info_twoGroup")
parse_lipid <- rgoslin::parseLipidNames(lipidNames=abundance_twoGroup$feature)
#> Encountered an error while parsing 'SE 27:1;0-14:0;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-15:0;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-16:0;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-16:1;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-17:0;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-17:1;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-18:1;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-18:2;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-18:3;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-19:2;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-19:3;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-20:2;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-20:4;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-20:5;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'SE 27:1;0-22:6;0': Expecting a single string value: [type=character; extent=4].
#> Encountered an error while parsing 'ST 27:1;0': Expecting a single string value: [type=character; extent=4].
recognized_lipid <- parse_lipid$Original.Name[which(parse_lipid$Grammar != 'NOT_PARSEABLE')]
abundance <- abundance_twoGroup %>% dplyr::filter(feature %in% recognized_lipid)
goslin_annotation <- parse_lipid %>% dplyr::filter(Original.Name %in% recognized_lipid)
se <- as_summarized_experiment(abundance, goslin_annotation,
group_info=group_info_twoGroup, se_type='de_two', paired_sample=FALSE)
#> Input data info
#> se_type: de_two
#> Number of lipids (features) available for analysis: 192
#> Number of samples: 23
#> Number of group: 2
#> Not paired samples.