clonalDiversity: Examine the clonal diversity of samples

View source: R/repertoire.r

clonalDiversityR Documentation

Examine the clonal diversity of samples

Description

This function calculates traditional measures of diversity - Shannon, inverse Simpson, Chao1 index, abundance-based coverage estimators (ACE), and 1-Pielou's measure of species evenness by sample or group. The function automatically down samples the diversity metrics using 100 boot straps The group parameter can be used to condense the individual samples. If a matrix output for the data is preferred, set exportTable = TRUE.

Usage

clonalDiversity(
  Combined,
  group.by = NULL,
  x.axis = NULL,
  split.by = NULL,
  exportTable = FALSE,
  n.boots = 100
)

Arguments

group.by

Variable in which to group the diversity calculation

x.axis

Additional variable in which to split the x.axis

split.by

If using a single-cell object, the column header to group the new list. NULL will return clusters.

exportTable

Exports a table of the data into the global environment in addition to the visualization

n.boots

number of bootstraps to downsample in order to get mean diversity

df

The product of combineTCR(), combineBCR(), expression2List(), or combineExpression().

cloneCall

How to call the clonotype - VDJC gene (gene), CDR3 nucleotide (nt), CDR3 amino acid (aa), or VDJC gene + CDR3 nucleotide (strict).

chain

indicate if both or a specific chain should be used - e.g. "both", "TRA", "TRG", "IGH", "IGL"

Value

ggplot of the diversity of clonotype sequences across list

Author(s)

Andrew Malone, Nick Borcherding

Examples

#Making combined contig data
x <- contig_list
combined <- combineTCR(x, rep(c("PX", "PY", "PZ"), each=2), 
rep(c("P", "T"), 3), cells ="T-AB")
clonalDiversity(combined, cloneCall = "gene")


JuanXie19/LRT documentation built on April 14, 2025, 7:09 p.m.