calc_entropy | R Documentation |
For each individual at each genomic position, calculate the entropy of the genotype probability distribution, as a quantitative summary of the amount of missing information.
calc_entropy(probs, quiet = TRUE, cores = 1)
probs |
Genotype probabilities, as calculated from
|
quiet |
IF |
cores |
Number of CPU cores to use, for parallel calculations.
(If |
We calculate -sum(p log_2 p), where we take 0 log 0 = 0.
A list of matrices (each matrix is a chromosome and is arranged as individuals x markers).
grav2 <- read_cross2(system.file("extdata", "grav2.zip", package="qtl2"))
probs <- calc_genoprob(grav2, error_prob=0.002)
e <- calc_entropy(probs)
e <- do.call("cbind", e) # combine chromosomes into one big matrix
# summarize by individual
mean_ind <- rowMeans(e)
# summarize by marker
mean_marker <- colMeans(e)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.