Plot VDJ contig capture efficiency across neighbourhoods
Source:R/plot_capture_efficiency.R
plot_capture_efficiency.RdGenerates two diagnostic plots summarising how efficiently VDJ contigs were captured across transcriptional neighbourhoods: a jittered boxplot of per-neighbourhood contig capture rate, and a scatterplot of contig count against neighbourhood size (with a linear fit) to check whether capture scales as expected with neighbourhood size.
Arguments
- nhood_diversity_df
The neighbourhood-level metadata data frame generated as the output of nhood_diversity, containing at minimum the columns
contig_capture_rate,n_contigsandnhood_size.- group_by
Character scalar giving the name of a column in
nhood_diversity_dfto colour/facet points by (e.g. cell type, timepoint, or tissue). IfNULL(the default) or not found incolnames(nhood_diversity_df), all neighbourhoods are treated as a single "All" group.
Value
A named list of two ggplot nhood_diversity_dfs:
- capture_rate
Jittered boxplot of
contig_capture_ratebygroup_by, with point size scaled tonhood_size.- count_vs_size
Scatterplot of
n_contigsagainstnhood_size, coloured bygroup_by, with a linear trend line.
Details
If group_by is supplied but is not already a factor, it is
coerced to one internally; the input nhood_diversity_df itself is not
modified. This function is purely a visualisation wrapper and does not
perform any capture-rate calculation itself.