entropyDiversity: Entropy-based sample diversity

Description Usage Arguments Value References See Also Examples

View source: R/entropy.R

Description

Entropy-based sample diversity

Usage

1

Arguments

mat

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

norm

Logical, whether the diversity should be normalized by log2(nrow(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

entropy and sampleSpecialization

Examples

1
2
3
4
5
6
7
myMat <- rbind(c(3,4,5),c(6,6,6), c(0,2,4))
entropyDiversity(myMat)
entropyDiversity(myMat, norm=TRUE)

myRandomMat <- matrix(runif(1000), ncol=20)
entropyDiversity(myRandomMat)
entropyDiversity(myRandomMat, norm=TRUE)

Example output

Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

[1] 0.9182958 1.4591479 1.5655962
[1] 0.5793802 0.9206198 0.9877812
 [1] 5.511097 5.380921 5.398291 5.425554 5.454348 5.394123 5.435731 5.267866
 [9] 5.386593 5.365192 5.404370 5.340664 5.396340 5.414300 5.293086 5.416430
[17] 5.425085 5.325802 5.338390 5.351428
 [1] 0.9764771 0.9534121 0.9564899 0.9613203 0.9664222 0.9557513 0.9631235
 [8] 0.9333805 0.9544171 0.9506252 0.9575669 0.9462793 0.9561441 0.9593264
[15] 0.9378492 0.9597037 0.9612373 0.9436459 0.9458763 0.9481864

BioQC documentation built on Nov. 8, 2020, 7:16 p.m.