testKS {scDD} | R Documentation

## testKS

### Description

Function to perform KS test

### Usage

    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

    # 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)

[Package scDD version 1.11.1 Index]