clonalAbundance: Demonstrate the relative abundance of clones by group or...

View source: R/clonalAbundance.R

clonalAbundanceR Documentation

Demonstrate the relative abundance of clones by group or sample

Description

Displays the number of clones at specific frequencies by sample or group. Visualization can either be a line graph ( scale = FALSE) using calculated numbers or density plot (scale = TRUE). Multiple sequencing runs can be group together using the group parameter. If a matrix output for the data is preferred, set exportTable = TRUE.

Usage

clonalAbundance(
  input.data,
  cloneCall = "strict",
  chain = "both",
  scale = FALSE,
  group.by = NULL,
  exportTable = FALSE,
  palette = "inferno"
)

Arguments

input.data

The product of combineTCR, combineBCR, or combineExpression.

cloneCall

How to call the clone - VDJC gene (gene), CDR3 nucleotide (nt), CDR3 amino acid (aa), VDJC gene + CDR3 nucleotide (strict) or a custom variable in the data.

chain

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

scale

Converts the graphs into density plots in order to show relative distributions.

group.by

The variable to use for grouping

exportTable

Returns the data frame used for forming the graph to the visualization.

palette

Colors to use in visualization - input any hcl.pals.

Value

ggplot of the total or relative abundance of clones across quanta

Examples

#Making combined contig data
combined <- combineTCR(contig_list, 
                        samples = c("P17B", "P17L", "P18B", "P18L", 
                                    "P19B","P19L", "P20B", "P20L"))
clonalAbundance(combined, 
                cloneCall = "gene", 
                scale = FALSE)


ncborcherding/scRepertoire documentation built on April 27, 2024, 8:34 p.m.