Skip to contents

plot_num_partners() creates bar plots for alpha and beta chains showing how many partners they are paired with by the MAD-HYPE and/or T-shell algorithms.

Usage

plot_num_partners(
  data,
  group_col = NULL,
  fraction = TRUE,
  include_non_functional = FALSE,
  max_partners = 5,
  samples = NULL,
  return_data = FALSE,
  color_scheme = NULL
)

Arguments

data

a dataset created by load_tirtlseq() and possibly filter_dataset()

group_col

a column of the metadata to use to group multiple samples into one bar plot

fraction

whether to plot the fraction of chains or the total number of chains (default is TRUE, i.e. plot fractions)

include_non_functional

whether to include chains with non-functional cdr3 sequences when tabulating the output.

max_partners

the maximum number of partners, N, to include in the plots. All chains with more than N partners will be grouped together under the ">N" category.

return_data

if TRUE, return the data used to make the plots

Value

Either a bar chart (ggplot object) with facets (sub-plots) for each sample or a list with two objects:

$plot the plot referenced above

$data the data used to create the plot

Details

For each sample, the function creates stacked bar charts for alpha and beta chains, showing the proportion of them (among all called pairs) that are paired with 1 chain, 2 chains, 3 chains, etc.

Examples

# example code