Plot clonotype assignment summary across stringency levels
Source:R/visualization_functions.R
plot_stringency_summary.RdCreates a two-panel bar chart showing how clonotype counts and cell assignments change across stringency levels. The top panel shows the number of unique clonotypes at each level (decreasing as clones merge). The bottom panel shows the number of cells assigned vs unassigned at each level. Counts are displayed on top of each bar.
Usage
plot_stringency_summary(
TCR_data,
mapping_levels = .mapping.levels,
sample_filter = NULL,
per_sample = FALSE,
combined = TRUE,
title = "Clonotype Assignment Summary"
)Arguments
- TCR_data
A data frame with clone ID columns for each stringency level (as output by
assign_clonotype).- mapping_levels
Character vector of stringency level names in order from most to least strict.
- sample_filter
Optional sample name to filter to. If
NULL, all samples are included. Ignored whenper_sample = TRUE.- per_sample
Logical. If
TRUE, create a separate plot for each unique sample.- combined
Logical. If
TRUEandper_sample = TRUE, combine all per-sample plots into a single figure usingpatchwork. IfFALSE, return a named list of plots.- title
Plot title.