KS: Calculate Kolmogorov Smirnov rank sum scores.

Description Usage Arguments Value Author(s) See Also Examples

Description

This function calculates the degree to which a subset of genes (i.e. a "signature") is biased in the ordered list of all genes. The function is typically used internally by dksClassify, but the user may want to call it directly to inspect the running sums.

Usage

1
KS(data, geneset, decreasing=TRUE, method="kort")

Arguments

data

A vector of gene expression data. The data need not be sorted, as the function will sort it itself.

geneset

A DKSGeneSet object, such as one of the slots of the DKSClassifier returned by link{dksClassify}.

decreasing

Indicates which way data should be sorted. If TRUE, the degree of upregulation will be scored. If FALSE, the degree of down regulation will be scored.

method

Two methods are supported. The 'kort' method returns the maximum of the running sum. The 'yang' method returns the sum of the maximum and the minimum of the running sum, thereby penalizing classes that are highly enriched in a subset of genes of a given signature, but highly down regulated in another subset of that same signature.

Value

runningSums

A matrix with 1 row per gene and 1 column per signature. The value is the running sum of the KS metric at each point along the sorted list of genes. The maximum of this column vector corresponds to the KS score for the corresponding signature.

ksScores

A named vector giving the KS score for each signature.

Author(s)

Eric J. Kort, Yarong Yang

See Also

dksTrain, dksSelectGenes, dksClassify, DKSGeneScores, DKSPredicted, DKSClassifier

Examples

1
2
3
4
5
	data("dks")
	tr <- dksTrain(eset, 1, "both")
	cl <- dksSelectGenes(tr, 100)
	sc <- KS(exprs(eset)[,1], cl@genes.up)
	plot(sc$runningSums[,1], type='l')

dualKS documentation built on Nov. 8, 2020, 8:30 p.m.