get_pseudobulk_logCPM_exprs: get_pseudobulk_logCPM_exprs

View source: R/expression_processing.R

get_pseudobulk_logCPM_exprsR Documentation

get_pseudobulk_logCPM_exprs

Description

get_pseudobulk_logCPM_exprs Calculate the 'library-size' normalized pseudbulk counts per sample for each gene - returned values are similar to logCPM.

Usage

get_pseudobulk_logCPM_exprs(sce, sample_id, celltype_id, group_id, batches = NA, assay_oi_pb = "counts", fun_oi_pb = "sum")

Arguments

sce

SingleCellExperiment object of the scRNAseq data of interest. Contains both sender and receiver cell types.

sample_id

Name of the meta data column that indicates from which sample/patient a cell comes from

celltype_id

Name of the column in the meta data of sce that indicates the cell type of a cell.

group_id

Name of the meta data column that indicates from which group/condition a cell comes from

batches

NA if no batches should be corrected for. If there should be corrected for batches during DE analysis and pseudobulk expression calculation, this argument should be the name(s) of the columns in the meta data that indicate the batch(s). Should be categorical. Pseudobulk expression values will be corrected for the first element of this vector.

assay_oi_pb

Indicates which information of the assay of interest should be used (counts, scaled data,...). Default: "counts". See 'muscat::aggregateData'.

fun_oi_pb

Indicates way of doing the pseudobulking. Default: "sum". See 'muscat::aggregateData'.

Value

Data frame with logCPM-like values of the library-size corrected pseudobulked counts ('pb_sample') per gene per sample. pb_sample = log2( ((pb_raw/effective_library_size) \* 1000000) + 1). effective_library_size = lib.size \* norm.factors (through edgeR::calcNormFactors).

Examples

## Not run: 
library(dplyr)
sample_id = "tumor"
group_id = "pEMT"
celltype_id = "celltype"
pseudobulk_logCPM_exprs = get_pseudobulk_logCPM_exprs(sce = sce, sample_id = sample_id, celltype_id =  celltype_id, group_id = group_id)

## End(Not run)


saeyslab/multinichenetr documentation built on Jan. 15, 2025, 7:55 p.m.