clonalCompare: Demonstrate the difference in clonal proportions / counts...

View source: R/clonalCompare.R

clonalCompareR Documentation

Demonstrate the difference in clonal proportions / counts between clones

Description

This function produces an alluvial or area graph of the proportion or count composition of the indicated clones for all or selected samples (using the samples parameter). Individual clones can be selected using the clones parameter with the specific sequence of interest or using the top.clones parameter with the top n clones by proportion / counts to be visualized.

Usage

clonalCompare(
  input.data,
  cloneCall = "strict",
  chain = "both",
  samples = NULL,
  clones = NULL,
  top.clones = NULL,
  highlight.clones = NULL,
  relabel.clones = FALSE,
  group.by = NULL,
  order.by = NULL,
  graph = "alluvial",
  proportion = TRUE,
  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"

samples

The specific samples to isolate for visualization.

clones

The specific clonal sequences of interest

top.clones

The top number of clonal sequences per group. (e.g., top.clones = 5)

highlight.clones

Clonal sequences to highlight, if present, all other clones returned will be grey

relabel.clones

Simplify the legend of the graph by returning clones that are numerically indexed

group.by

If using a single-cell object, the column header to group the new list. NULL will return the active identity or cluster

order.by

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

graph

The type of graph produced, either "alluvial" or "area"

proportion

If TRUE, the proportion of the total sequencing reads will be used for the y-axis. If FALSE, the raw count will be used

exportTable

Returns the data frame used for forming the graph

palette

Colors to use in visualization - input any hcl.pals

Value

ggplot of the proportion of total sequencing read of selecting clones

Examples

#Making combined contig data
combined <- combineTCR(contig_list,
                       samples = c("P17B", "P17L", "P18B", "P18L",
                                   "P19B","P19L", "P20B", "P20L"))
clonalCompare(combined,
              top.clones = 5,
              samples = c("P17B", "P17L"),
              cloneCall="aa")


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