Entropy-based sample specialization

sampleSpecialization(mat, norm = TRUE)

Arguments

mat

A matrix (usually an expression matrix), with genes (features) in rows and samples in columns.

norm

Logical, whether the specialization should be normalized by log2(ncol(mat)).

Value

A vector as long as the column number of the input matrix

References

Martinez and Reyes-Valdes (2008) Defining diversity, specialization, and gene specificity in transcriptomes through information theory. PNAS 105(28):9709--9714

See also

Examples

myMat <- rbind(c(3,4,5),c(6,6,6), c(0,2,4)) sampleSpecialization(myMat)
#> [1] 0.01332588 0.07558228 0.11293612
sampleSpecialization(myMat, norm=TRUE)
#> [1] 0.01332588 0.07558228 0.11293612
myRandomMat <- matrix(runif(1000), ncol=20) sampleSpecialization(myRandomMat)
#> [1] 0.06834179 0.06481445 0.06571096 0.06345388 0.06278717 0.06436784 #> [7] 0.06527698 0.06225818 0.06402973 0.06570540 0.06448398 0.06679575 #> [13] 0.06326795 0.06204996 0.06538794 0.06051159 0.06480306 0.06481328 #> [19] 0.06565086 0.06624296
sampleSpecialization(myRandomMat, norm=TRUE)
#> [1] 0.06834179 0.06481445 0.06571096 0.06345388 0.06278717 0.06436784 #> [7] 0.06527698 0.06225818 0.06402973 0.06570540 0.06448398 0.06679575 #> [13] 0.06326795 0.06204996 0.06538794 0.06051159 0.06480306 0.06481328 #> [19] 0.06565086 0.06624296