testKS: testKS

Description Usage Arguments Value References Examples

View source: R/Test_KS.R

Description

Function to perform KS test

Usage

1
testKS(dat, condition, inclZero = TRUE, numDE = NULL, DEIndex)

Arguments

dat

Matrix of single-cell RNA-seq data with genes in rows and samples in columns.

condition

Vector containing the indicator of which condition each sample (in the columns of dat) belongs to.

inclZero

Logical indicating whether to include zero in the test of different distributions

numDE

numeric value for the number of genes that will differ between two conditions

DEIndex

Vector containing the row numbers of the DE genes

Value

List object containing the significant gene indices, their adjusted p-values, and (if DE genes are supplied) the power and fdr.

References

Korthauer KD, Chu LF, Newton MA, Li Y, Thomson J, Stewart R, Kendziorski C. A statistical approach for identifying differential distributions in single-cell RNA-seq experiments. Genome Biology. 2016 Oct 25;17(1):222. https://genomebiology.biomedcentral.com/articles/10.1186/s13059-016-1077-y

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# load toy simulated example ExpressionSet to find KS genes

data(scDatExSim)


# load SingleCellExperiment package to facilitate subset operations

library(SingleCellExperiment)


# check that this object is a member of the ExpressionSet class
# and that it contains 200 samples and 30 genes

class(scDatExSim)
show(scDatExSim)

# perform KS test and obtain adjusted p-values
RES_KS <- testKS(normcounts(scDatExSim), scDatExSim$condition, inclZero=FALSE,
                 numDE=20, DEIndex=1:20)

scDD documentation built on Nov. 8, 2020, 7:10 p.m.