calculate_inverse_simpson: #' Calculate inverse Simpson index for a vector of...

View source: R/diversity_functions.R

calculate_inverse_simpsonR Documentation

#' Calculate inverse Simpson index for a vector of transcript-level expression values of one gene.

Description

#' Calculate inverse Simpson index for a vector of transcript-level expression values of one gene.

Usage

calculate_inverse_simpson(x)

Arguments

x

Vector of expression values.

Details

The function calculates an inverse Simpson index as part of different diversity calculations. Given a vector of transcript-level expression values of a gene, this function characterize the diversity of splicing isoforms for a gene. If there only one single transcript, the resulted index will be NaN, as diversity cannot be calculated. If the expression of the given gene is 0, the diversity index will be NA.

Value

A single gene-level inverse Simpson index.

Examples

# read counts for the transcripts of a single gene with 5 transcripts
x <- rnbinom(5, size = 10, prob = 0.4)
# calculate inverse Simpson index
invsimpson <- calculate_inverse_simpson(x)

SU-CompBio/SplicingFactory documentation built on March 28, 2022, 4:39 a.m.