calculate_gini: Calculate Gini coefficient for a vector of transcript-level...

Description Usage Arguments Details Value Examples

View source: R/diversity_functions.R

Description

Calculate Gini coefficient for a vector of transcript-level expression values of one gene.

Usage

1

Arguments

x

Vector of expression values.

Details

The function calculates a Gini coefficient 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 Gini coefficient.

Examples

1
2
3
4
# read counts for the transcripts of a single gene with 5 transcripts
x <- rnbinom(5, size = 10, prob = 0.4)
# calculate Gini index
gini <- calculate_gini(x)

esebesty/SplicingFactory documentation built on Feb. 27, 2022, 12:08 a.m.