Description Usage Arguments Value Examples
Measures the Euclidean distance between the two highest peaks of the 2D density function. The density is estimated from the samples' distribution in the first two principal components of a PCA, using the genes of a given signature.
1 2 |
signature |
character vector with the signature's gene identifiers |
data |
Gene expression matrix where rownames correspond to unique gene
identifiers in |
threshold |
density cutoff. Density values lower than the
|
n |
Number of grid points in each direction. Can be scalar or a length-2 integer vector. See kde2d. |
magnitude |
When TRUE the score is multiplied by the cluster density. Default: FALSE. |
scale |
a logical value indicating whether the variables should be scaled to have unit variance before the analysis takes place. See prcomp for more details. Default: FALSE. |
filtered |
logical value indicating if genes in the supplied
|
A vector of length 2. The first value corresponds to the score and
the second to the number of genes in the signature
that were found in
the data
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | dummyData <- do.call(rbind, lapply(seq(0.1, 0.9, by = 0.1),
rnorm, n = 100, m = 6))
#add a row with bimodal gene expression
dummyData <- rbind(dummyData, c(rnorm(70, 6, 0.1), rnorm(30, 9, 0.1)))
rownames(dummyData) <- paste(rep("gene", nrow(dummyData)),
seq(1, nrow(dummyData)), sep = "")
rownames(dummyData)
dummySig <- c("gene1", "gene8", "gene9", "gene10", "gene20", "gene30")
peakDistance2d(dummySig, dummyData)
#values correspond to the peak distance, the number of genes from the
#signature found in the data and the total number of genes in the signature
#respectively
#removing the bimodal gene from the signature results to a lower score
peakDistance2d(dummySig[-4], dummyData)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.