PlotFilters: Plot filtering thresholds and distributions

View source: R/Seurat.Utils.Visualization.R

PlotFiltersR Documentation

Plot filtering thresholds and distributions

Description

This function plots the filtering thresholds and distributions for Seurat objects, using four panels to highlight the relationship between gene- and UMI-counts, and the ribosomal- and mitochondrial-content. !! Default arguments assume that p is a list of parameters, present in the global environment, with elements thr.lp.mito, thr.hp.mito, thr.lp.ribo, thr.hp.ribo, thr.lp.nFeature_RNA, and thr.hp.nFeature_RNA.

Usage

PlotFilters(
  ls.obj = ls.Seurat,
  par.ls = p,
  parentdir = OutDirOrig,
  suffices = names(ls.obj),
  filetype = ".png",
  below.mito = par.ls$thr.lp.mito,
  above.mito = par.ls$thr.hp.mito,
  below.ribo = par.ls$thr.lp.ribo,
  above.ribo = par.ls$thr.hp.ribo,
  below.nFeature_RNA = if ("quantile.thr.lp.nFeature_RNA" %in% names(par.ls))
    par.ls$quantile.thr.lp.nFeature_RNA else par.ls$thr.lp.nFeature_RNA,
  above.nFeature_RNA = par.ls$thr.hp.nFeature_RNA,
  subdir = FixPlotName("Filtering.plots", "mito", par.ls$thr.hp.mito, par.ls$thr.lp.mito,
    "ribo", par.ls$thr.hp.ribo, par.ls$thr.lp.ribo, "nFeature", below.nFeature_RNA,
    above.nFeature_RNA),
  transparency = 0.25,
  cex = 0.75,
  theme.used = theme_bw(base_size = 18),
  LabelDistFromTop = 200
)

Arguments

ls.obj

A list of Seurat objects to be analyzed. Default: ls.Seurat.

parentdir

The parent directory where the plots will be stored. Default: OutDirOrig.

suffices

Suffixes used in the output plot file names. Default: Names of the Seurat objects in ls.obj.

filetype

The file type of the output plot images. Default: '.png'.

below.mito

Lower bound of mitochondrial content. Default: p$thr.lp.mito.

above.mito

Upper bound of mitochondrial content. Default: p$thr.hp.mito.

below.ribo

Lower bound of ribosomal content. Default: p$thr.lp.ribo.

above.ribo

Upper bound of ribosomal content. Default: p$thr.hp.ribo.

below.nFeature_RNA

Lower bound of RNA features. Default: p$thr.lp.nFeature_RNA.

above.nFeature_RNA

Upper bound of RNA features. Default: p$thr.hp.nFeature_RNA.

subdir

Subdirectory within parentdir where plots will be stored. Default: generated using a call to kpp().

transparency

Point transparency on scatter plots. Default: 0.25.

cex

Size of points on scatter plots. Default: 0.75.

theme.used

A ggplot2 theme for all plots. Default: theme_bw(base_size = 18).

LabelDistFromTop

Distance from top for label placement. Default: 200.

See Also

ggplot, labs, geom_point

Examples

## Not run: 
if (interactive()) {
  # !! Default arguments assume that `p` is a list of parameters, present in the global
  # environment, with elements `thr.lp.mito`, `thr.hp.mito`, `thr.lp.ribo`, `thr.hp.ribo`,
  # `thr.lp.nFeature_RNA`, and `thr.hp.nFeature_RNA`.
  PlotFilters(ls.Seurat)
}

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.