Skip to contents

This function generates QC and general metadata plots that are visualised in dimensional reduced space (e.g. PCA and UMAP). The aim is to visualise weather there are any technical factors driving the variability in the data, e.g. integration driven by sample, correlation of specific PCs with number of genes expressed in a cell, etc.

Usage

dimred_qc_plots(
  seu,
  reductions = c("pca"),
  metadata_to_plot = NULL,
  qc_to_plot = NULL,
  plot_dir,
  max.cutoff = "q98",
  min.cutoff = NA,
  legend.position = "right",
  cont_col_pal = NULL,
  discrete_col_pal = NULL,
  dims_plot = c(1, 2),
  pt.size = 1.4,
  fig.res = 200,
  ...
)

Arguments

seu

Seurat object (required).

reductions

Vector with dimensional reductions objects to use for plotting the metadata and QC features.

metadata_to_plot

Vector with metadata names to plot, they should be present in the meta.data slot.

qc_to_plot

Vector with QC names to plot, they should be present in the meta.data slot.

plot_dir

Directory to save generated plots. If NULL, plots are not saved.

max.cutoff

Vector of maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10').

min.cutoff

Vector of minimum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10').

legend.position

Position of legend, default "right" (set to "none" for clean plot).

cont_col_pal

Continuous colour palette to use, default "RdYlBu".

discrete_col_pal

Discrete colour palette to use, default is Hue palette (hue_pal) from 'scales' package.

dims_plot

Dimensions to plot. For UMAP and TSNE this is set to c(1,2).

pt.size

Adjust point size for plotting.

fig.res

Figure resolution in ppi (see 'png' function).

...

Additional named parameters passed to Seurat's DimPlot and FeaturePlot.

Value

Nothing, plots are saved in the specified folder if not NULL.

Author

C.A.Kapourani C.A.Kapourani@ed.ac.uk