SignaturePlotQC: QC plot with signatures highlight

View source: R/SignaturePlotQC.R

SignaturePlotQCR Documentation

QC plot with signatures highlight

Description

This function makes quality control (QC) plots from a Seurat object, by default percent.mito vs nFeature_RNA, while highlighting signature scores in color.

Usage

SignaturePlotQC(
  object,
  signatures,
  x = "nFeature_RNA",
  y = "percent.mito",
  log.scale = TRUE,
  ncol = NA,
  pt.size = 1,
  assay = DefaultAssay(object),
  layer = "data"
)

Arguments

object

Seurat object. Must contain nFeature_RNA and percent.mito metadata columns, or the x and y plot parameters must be changed accordingly to plot other QC info otherwise.

signatures

character(n) or list(character(1)) or named list(n) vector containing the names of the signatures to highlight in color. Can be metadata columns or assay features. If a named list of signatures is passed, the names of the list will be used. If values are not found in the metadata, they will be picked from assay features. If the feature is found in several assays, it should be further defined with an underscore separator, in the form "assay_feature".

x

Which parameter to set to the x axis in the QC plot (Default: nFeature_RNA).

y

Which parameter to set to the y axis in the QC plot (Default: percent.mito).

log.scale

logical(1). Whether to plot with log.scale or not (Default: TRUE)

ncol

num(1). Number of columns (Default = NA, determined from the data)

pt.size

num(1). The point size, passed to ggplot (Default: 1)

assay

character(1). If some values to highlight are features rather than metadata columns, the assay from which they should be pulled in priority (Default: DefaultAssay(object)).

layer

character(1). If some values to highlight are features rather than metadata columns, the layer from which they should be pulled (Default: "data").

Details

Can also be used in general as a combination of scatter plot and feature plot, as any metadata/signature/feature can be used for x and y axis as well as for color.

This is useful when making scRNA-seq from heterogeneous samples: for example immune cells are small and might be discarded as debris from much larger epithelial cancer cells if one is not aware of the differences in QC parameters occurring between various cell types.

Value

Returns a ggplot/cowplot grid object.

Examples

# After MySeuratObject has been log-normalized in order to contain an RNA>data assay>layer and been augmented with a percent.mito metadata column:
# SignatureList should be a list of character vectors, each containing a series of feature/gene names.
MySeuratObject <- Impute(MySeuratObject)
MySeuratObject <- ScoreSignatures(MySeuratObject,SignatureList)
SignaturePlotQC(MySeuratObject,names(SignatureList))
SignaturePlotQC(MySeuratObject,x="MKI67",y="PCNA",log.scale=FALSE,pt.size=1.5,)

nbroguiere/burgertools documentation built on Jan. 30, 2024, 3:48 a.m.