
Batch diagnostic figure: the embedding coloured by batch, plus the LISI distribution against its permutation null
Source:R/diagnostics.R
fig_batch_diagnostic.RdWHY BOTH PANELS: the scatter is what a reader will look at anyway and it shows WHERE any batch structure sits; the LISI distribution is what says whether the pattern the eye finds is more than chance. Neither alone is enough – a scattered-looking plot can still be significantly structured at these n, and a significant score with no visible pattern is usually one small batch.
Usage
fig_batch_diagnostic(
cells,
report,
outfile,
batch_col,
facet_col = NULL,
panel_label = "",
dpi = 200,
colors = fcs_colors()
)Arguments
- cells
Embedded cell table: one row per cell, carrying
umap_1/umap_2,sample_id,population_labeland one column per marker.- report
The report.
- outfile
Path to write the figure to.
- batch_col
Column naming the acquisition batch.
- facet_col
Column of
cellssplitting the embedding panel into one UMAP per level – the timepoint, typically. NULL, or a column with fewer than two levels, draws the single pooled embedding. DefaultNULL.- panel_label
Marker-panel name added to the figure title; empty for none. Default
"".- dpi
Resolution in dots per inch. May be reduced automatically to respect the raster ceiling; see
safe_ggsave(). Default200.- colors
Named list of colours; defaults to the package palette. See
fcs_colors(). Defaultfcs_colors().