plotQCscatter: plotQCscatter

Description Usage Arguments Details Value Examples

View source: R/plotQCscatter.R

Description

Quality control (QC) plots for spatial transcriptomics datasets.

Usage

1
2
3
4
5
6
7
8
9
plotQCscatter(
  spe,
  metric_x = "cell_count",
  metric_y = "sum",
  threshold_x = NULL,
  threshold_y = NULL,
  trend = TRUE,
  marginal = FALSE
)

Arguments

spe

Input object (SpatialExperiment).

metric_x

Name of column in colData containing QC metric to plot on x-axis (e.g. "cell_count" for number of cells per spot). Default = "cell_count".

metric_y

Name of column in colData containing QC metric to plot on y-axis (e.g. "sum" for number of detected transcripts, "detected" for number of detected genes). Default = "sum".

threshold_x

If provided, a vertical line will be drawn at this x-value. Default = NULL.

threshold_y

If provided, a horizontal line will be drawn at this y-value. Default = NULL.

trend

Whether to include a smoothed trend (loess). Default = TRUE.

marginal

Whether to include marginal histograms. Note that if TRUE, the returned object is no longer a ggplot2 object, and additional ggplot2 plot elements can no longer be added. Alternatively, marginal histograms can be added manually with 'ggMarginal(p, type = "histogram")' (from 'ggExtra' package). Default = FALSE.

Details

Functions to generate quality control (QC) plots for spatial transcriptomics datasets.

This function generates a scatterplot comparing two quality control (QC) metrics, e.g. number of detected features vs. number of cells per spot. This can be used to help select filtering thresholds.

Value

Returns a ggplot object. Additional plot elements can be added as ggplot elements (e.g. title, formatting).

Examples

1
# to do

lmweber/spatzli documentation built on Sept. 16, 2020, 5:55 a.m.