Calculate population-level cell type proportions from single-cell data.

pop.ct.prop.scRNA(scRNA,cluster="cluster",sample="sample",cell_type_unique)

Arguments

scRNA

The `ExpressionSet` object for single-cell data.

cluster

The character string specifying the variable name for cell types. The default is "cluster".

sample

The character string specifying the variable name for subject/samples. The default is "sample".

cell_type_unique

A vector of cell types. It should match the order in list.marker.

Value

The population-level cell type proportions (`pop.ct.prop`) and corresponding standard deviations (`pop.ct.sd`).

Examples

##read data
library(InteRD)
readRDSFromWeb<-function(ref) {readRDS(gzcon(url(ref)))}
urlremote<-"https://github.com/chencxxy28/Data/raw/main/data_InteRD/"
seger<-readRDSFromWeb(paste0(urlremote,"segerstolpe.rds"))
cell_type_unique<-c("alpha","beta","delta","gamma")
ave_est<-pop.ct.prop.scRNA(scRNA=seger[["sc.eset.qc"]],
cell_type_unique=cell_type_unique)$pop.ct.prop
ave_est
#>      alpha       beta      delta      gamma 
#> 0.58701276 0.23180970 0.08954594 0.09163159