fx_calcCGS: Internal fx for cluster-wise gene statistics

View source: R/deTest.R

fx_calcCGSR Documentation

Internal fx for cluster-wise gene statistics

Description

Internal function. See CalcCGS.

Usage

fx_calcCGS(nge, cl, exponent, pseudocount)

Arguments

nge

The log-normalized gene expression matrix.

cl

The factor with cluster assignments per cell (column of nge).

exponent

Default = 2. A length-one numeric vector representing the base of the log-normalized gene expression data to be processed. Generally gene expression data is transformed into log2 space when normalizing (set this to 2), though Seurat uses the natural log (set this to exp(1)). If you are using data that has not been log-transformed (for example, corrected counts from SCTransform), set this to NA.

pseudocount

Default = 1. A length-one numeric vector representing the pseudocount added to all log-normalized values in your input data. Most methods use a pseudocount of 1 to eliminate log(0) errors. If you are using data that has not been log-transformed (for example, corrected counts from SCTransform), set this to NA.

Value

The function returns a list of dataframes. Each list element contains a named list of clusters at that resolution. Each of those list elements contains a dataframe of three variables, where each sample is a gene. DR is the proportion of cells in the cluster in which that gene was detected. MDGE is mean normalized gene expression for that gene in only the cells in which it was detected (see meanLogX for mean calculation). MGE is the mean normalized gene expression for that gene in all cells of the cluster (see meanLogX for mean calculation).


BaderLab/scClustViz documentation built on Sept. 10, 2023, 11:51 p.m.