get_shannon_diversity_index: Get Shannon Diversity Index for Signatures

View source: R/get_shannon_diversity_index.R

get_shannon_diversity_indexR Documentation

Get Shannon Diversity Index for Signatures

Description

H = - \sum_{i=1}^n{p_i ln(p_i)}

where n is the number of signatures identified in the signature with exposure > cutoff, and pi is the normalized exposure of the ith signature with exposure > cutoff. Exposures of signatures were normalized to sum to 1.

Usage

get_shannon_diversity_index(rel_expo, cutoff = 0.001)

Arguments

rel_expo

a data.frame with numeric columns indicating relative signature exposures for each sample. Typically this data can be obtained from get_sig_exposure().

cutoff

a relative exposure cutoff for filtering signatures, default is ⁠0.1%⁠.

Value

a data.frame

References

Steele, Christopher D., et al. "Undifferentiated sarcomas develop through distinct evolutionary pathways." Cancer Cell 35.3 (2019): 441-456.

Examples

# Load mutational signature
load(system.file("extdata", "toy_mutational_signature.RData",
  package = "sigminer", mustWork = TRUE
))
# Get signature exposure
rel_expo <- get_sig_exposure(sig2, type = "relative")
rel_expo
diversity_index <- get_shannon_diversity_index(rel_expo)
diversity_index

sigminer documentation built on Aug. 21, 2023, 9:08 a.m.