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
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.