diffAbundanceFET: Calculate Differential Abundance with FET

View source: R/abundance.R

diffAbundanceFETR Documentation

Calculate Differential Abundance with FET

Description

Calculate Differential Abundance with FET

Usage

diffAbundanceFET(inSCE, cluster, variable, control, case, analysisName)

Arguments

inSCE

A SingleCellExperiment object.

cluster

A single character, specifying the name to store the cluster label in colData.

variable

A single character, specifying the name to store the phenotype labels in colData.

control

character. Specifying one or more categories that can be found in the vector specified by variable.

case

character. Specifying one or more categories that can be found in the vector specified by variable.

analysisName

A single character. Will be used for naming the result table, which will be saved in metadata slot.

Details

This function will calculate the cell counting and fraction by dividing all cells to groups specified by the arguments, together with statistical summary by performing Fisher Exact Tests (FET).

Value

The original SingleCellExperiment object with metadata(inSCE) updated with a list diffAbundanceFET, containing a new data.frame for the analysis result, named by analysisName. The data.frame contains columns for number and fraction of cells that belong to different cases, as well as "Odds_Ratio", "PValue" and "FDR".

Examples

data("mouseBrainSubsetSCE", package = "singleCellTK")
mouseBrainSubsetSCE <- diffAbundanceFET(inSCE = mouseBrainSubsetSCE,
                                                cluster = "tissue",
                                                variable = "level1class",
                                                case = "oligodendrocytes",
                                                control = "microglia",
                                                analysisName = "diffAbundFET")

compbiomed/singleCellTK documentation built on Feb. 10, 2024, 3:32 a.m.