Skip to contents

Creates from a list of SummarizedExperiments a multi-view representation for MOFA

Usage

pb_dat2MOFA(pb_dat_list, sample_column = "donor_id")

Arguments

pb_dat_list

List of SummarizedExperiment generated from MOFAcellulaR::filt_profiles()

Value

Data frame in a multiview representation

Details

This function is the last data preparation step for a multicellular factor analysis. It collects a collection of cell-type-specific SummarizedExperiments into a single data frame ready to be used in MOFA. Features are modified so as to reflect their cell type of origin.

Examples

inputs_dir <- base::system.file("extdata", package = "MOFAcellulaR")
load(file.path(inputs_dir, "testpbcounts.rda"))
load(file.path(inputs_dir, "testcoldata.rda"))
pb_obj <- create_init_exp(counts = testpbcounts,  coldata = testcoldata)

ct_list <- filt_profiles(pb_dat = pb_obj,
                         cts = c("Fib","CM"),
                         ncells = 5,
                         counts_col = "cell_counts",
                         ct_col = "cell_type")

ct_list <- filt_gex_byexpr(pb_dat_list = ct_list,
                           min.count = 5,
                           min.prop = 0.25)
#> Warning: All samples appear to belong to the same group.
#> Warning: All samples appear to belong to the same group.

ct_list <- tmm_trns(pb_dat_list = ct_list,
                    scale_factor = 1000000)

multiview_dat <- pb_dat2MOFA(pb_dat_list = ct_list)