vizGenes: Visualizing the distribution of gene usage

View source: R/vizGenes.R

vizGenesR Documentation

Visualizing the distribution of gene usage

Description

This function will allow for the visualizing the distribution of the any VDJ and C gene of the TCR or BCR using heatmap or bar chart. This function requires assumes two chains were used in defining clone, if not, it will default to the only chain present regardless of the chain parameter.

Usage

vizGenes(
  input.data,
  x.axis = "TRBV",
  y.axis = NULL,
  group.by = NULL,
  plot = "heatmap",
  order = "gene",
  scale = TRUE,
  exportTable = FALSE,
  palette = "inferno"
)

Arguments

input.data

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

x.axis

Gene segments to separate the x-axis, such as "TRAV", "TRBD", "IGKJ".

y.axis

Variable to separate the y-axis, can be both categorical or other gene gene segments, such as "TRAV", "TRBD", "IGKJ".

group.by

Variable in which to group the diversity calculation.

plot

The type of plot to return - heatmap or barplot.

order

Categorical variable to organize the x-axis, either "gene" or "variance"

scale

Converts the individual count of genes to proportion using the total respective repertoire size

exportTable

Returns the data frame used for forming the graph.

palette

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

Value

ggplot bar diagram or heatmap of gene usage

Examples

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

vizGenes(combined, 
         x.axis = "TRBV",
         y.axis = NULL,
         plot = "heatmap")


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