Generate circular plots of clonal expansion per repertoire directly from the VDJ matrix of the VDJ_GEX_matrix function

VDJ_clonal_donut(
  VDJ,
  counts.to.use,
  label.size,
  not.expanded.label.vjust,
  not.expanded.label.hjust,
  total.label.vjust,
  total.label.hjust,
  expanded.colors,
  non.expanded.color
)

Arguments

VDJ

VDJ dataframe generated using the VDJ_GEX_matrix function (VDJ_GEX_matrix.output[[1]]). Plots will be made by sample and using the clonal frequencies specified by counts.to.use

counts.to.use

How to count clonotypes and cells. A column name of the VDJ matrix containing clonotype IDs. This defaults to "clonotype_id_10x", which reflects clonotypes by Cellranger in an unaltered VGM. To use counts from the VDJ_clonotype_v3 function set this parameter to the relevant column e.g. "clonotype_id_cdr.aa" or "global_clonotype_id_cdr.aa" are two examples.

label.size

Size of text labels. All parameters below are purely for graphical purposes and optional. If necessary changes should be made in small (0.1) increments. ! It is recommended to optimize these ONLY once a format for saving the plot is set.

not.expanded.label.vjust

Numeric. Regulates the vertical position of the label for non expanded cells

not.expanded.label.hjust

Numeric. Regulates the horizontal position of the label for non expanded cells

total.label.vjust

Numeric. Regulates the vertical position of the center label

total.label.hjust

Numeric. Regulates the horizontal position of the center label

expanded.colors

Character vector. Colors to use for expanded clones. Should be more than 3 for better visibility. Defaults to a "darkorchid3"-based palette.

non.expanded.color

Character. Color to use for non expanded clones. Defaults to "black"

Value

Returns a list of circular plots showing proportions of expanded clones and non-expanded clones. One plot is generated for each sample in the sample_id column

Examples

VDJ_clonal_donut(VDJ = Platypus::small_vgm[[1]])
#> Using column clonotype_id_10x for counting clones
#> Clones: Expanded: 0 / 0%; 1 cell 28 / 100%; total: 28
#> Cells: Expanded: 0 / 0%; 1 cell 28 / 100%; Total: 28
#> Clones: Expanded: 0 / 0%; 1 cell 9 / 100%; total: 9
#> Cells: Expanded: 0 / 0%; 1 cell 9 / 100%; Total: 9
#> Clones: Expanded: 0 / 0%; 1 cell 13 / 100%; total: 13
#> Cells: Expanded: 0 / 0%; 1 cell 13 / 100%; Total: 13
#> [[1]]

#> 
#> [[2]]

#> 
#> [[3]]

#>