
Compute QC metrics and generate pre-filtration QC plots
PlotQCMetrics.RdAdds mitoRatio, riboRatio, and log10GenesPerUMI to the object, then
saves four PDFs:
Doublet barplot - cells per sample colored by
DoubletStatus(only if that column exists fromSCP::db_scDblFinder).miQC keep barplot - cells per sample colored by
miQC.keep(only if that column exists fromSeuratWrappers::RunMiQC).QC density + violin plots - four metrics side-by-side with user-defined cutoff guidelines.
Cell count barplot - cells per sample before any filtering.
Usage
PlotQCMetrics(
seurat_object,
sample_col = "Sample",
sample_levels = NULL,
group_col = NULL,
output_dir,
object_name = "",
subset_name = "",
species = "human",
mt_pattern = NULL,
ribo_pattern = NULL,
assay = "RNA",
sample_colors = NULL,
count_vlines = c(500, 50000),
feature_vlines = c(300, 80000),
mito_vline = 0.1,
complexity_vline = 0.8
)Arguments
- seurat_object
Seurat object (merged, unfiltered).
- sample_col
Character. Metadata column holding sample identity. Default
"Sample".- sample_levels
Character vector or
NULL. Desired factor level order forsample_col.NULLleaves the current order unchanged.- group_col
Character or
NULL. Column used to color bars in the doublet and miQC barplots (e.g."orig.ident").NULLusessample_col.- output_dir
Character. Directory for PDF output.
- object_name, subset_name
Character. Prefix components for PDF filenames.
- species
Character. Controls the default mitochondrial and ribosomal gene patterns. One of:
"human"-mt_pattern = "^MT-",ribo_pattern = "^RP[LS]""mouse"-mt_pattern = "^mt-",ribo_pattern = "^Rp[ls]"
- mt_pattern
Character or
NULL. Override the mitochondrial gene regex.NULLderives fromspecies.- ribo_pattern
Character or
NULL. Override the ribosomal gene regex.NULLderives fromspecies.- assay
Character. Seurat assay for
PercentageFeatureSet(). Default"RNA".- sample_colors
Named character vector mapping
sample_collevels to colors.NULLauto-generates fromNour_pal().- count_vlines
Numeric vector. Vertical guide lines on the nCount_RNA density plot. Default
c(500, 50000).- feature_vlines
Numeric vector. Guide lines on the nFeature_RNA density plot. Default
c(300, 80000).- mito_vline
Numeric. Guide line on the mitoRatio density plot. Default
0.1.- complexity_vline
Numeric. Guide line on the log10GenesPerUMI density plot. Default
0.8.