Skip to contents

Filter pseudobulk profiles of specific cell types based on the number of cells from which they were generated.

Usage

filt_profiles(
  pb_dat,
  cts,
  ncells = 50,
  counts_col = "cell_counts",
  ct_col = "cell_type"
)

Arguments

pb_dat

SummarizedExperiment generated from MOFAcellulaR::create_init_exp()

cts

A vector containing the names of cells to be used in the analysis

ncells

Number of minimum cells of each pseudobulk profile

counts_col

String pointing to the column in colData(pb_dat) where the number of cells per pseudobulk was stored

ct_col

String pointing to the column in colData(pb_dat) where the cell-type category per pseudobulk was stored

Value

A named list of SummarizedExperiments per cell type provided with filtered pseudobulk profiles

Details

This function assumes that you have a SummarizedExperiment object with information in colData(object) specifying the number of cells used for each profile and the cell-type grouping this profiles. The function then will select only the cell-types provided by the user and filter the profiles with less cells as the ones specified.

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")