positionalEntropy: Examining the diversity of amino acids by position

View source: R/positionalEntropy.R

positionalEntropyR Documentation

Examining the diversity of amino acids by position

Description

This function the diversity amino acids along the residues of the CDR3 amino acid sequence. Please see clonalDiversity() for more information on the underlying methods for diversity/entropy calculations. Positions without variance will have a value reported as 0 for the purposes of comparison.

Usage

positionalEntropy(
  input.data,
  chain = "TRB",
  group.by = NULL,
  order.by = NULL,
  aa.length = 20,
  method = "norm.entropy",
  exportTable = FALSE,
  palette = "inferno"
)

Arguments

input.data

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

chain

"TRA", "TRB", "TRG", "TRG", "IGH", "IGL"

group.by

The variable to use for grouping

order.by

A vector of specific plotting order or "alphanumeric" to plot groups in order

aa.length

The maximum length of the CDR3 amino acid sequence.

method

The method to calculate the entropy/diversity - "shannon", "inv.simpson", "norm.entropy"

exportTable

Returns the data frame used for forming the graph

palette

Colors to use in visualization - input any hcl.pals

Value

ggplot of line graph of diversity by position

Examples

#Making combined contig data
combined <- combineTCR(contig_list, 
                        samples = c("P17B", "P17L", "P18B", "P18L", 
                                    "P19B","P19L", "P20B", "P20L"))
positionalEntropy(combined, 
                  chain = "TRB", 
                  aa.length = 20)

ncborcherding/scRepertoire documentation built on Nov. 5, 2024, 2:05 p.m.