plotSoupXResults: Plot SoupX Result

View source: R/runSoupX.R

plotSoupXResultsR Documentation

Plot SoupX Result

Description

This function will generate a combination of plots basing on the correction done by SoupX. For each sample, there will be a UMAP with cluster labeling, followed by a number of UMAPs showing the change in selected top markers. The cluster labeling is what should be used for SoupX to estimate the contamination. The Soup Fraction is calculated by subtracting the gene expression value of the output corrected matrix from that of the original input matrix, and then devided by the input.

Usage

plotSoupXResults(
  inSCE,
  sample = NULL,
  background = FALSE,
  reducedDimName = NULL,
  plotNCols = 3,
  plotNRows = 2,
  baseSize = 8,
  combinePlot = c("all", "sample", "none"),
  xlab = NULL,
  ylab = NULL,
  dim1 = NULL,
  dim2 = NULL,
  labelClusters = FALSE,
  clusterLabelSize = 3.5,
  defaultTheme = TRUE,
  dotSize = 0.5,
  transparency = 1,
  titleSize = NULL,
  axisLabelSize = NULL,
  axisSize = NULL,
  legendSize = NULL,
  legendTitleSize = NULL
)

Arguments

inSCE

A SingleCellExperiment object. With runSoupX already applied.

sample

Character vector. Indicates which sample each cell belongs to. Default NULL.

background

Logical. Whether background was applied when running runSoupX. Default FALSE.

reducedDimName

Character. The embedding to use for plotting. Leave it NULL for using the sample-specific UMAPs generated when running runSoupX. Default NULL.

plotNCols

Integer. Number of columns for the plot grid per sample. Will determine the number of top markers to show together with plotNRows. Default 3.

plotNRows

Integer. Number of rows for the plot grid per sample. Will determine the number of top markers to show together with plotNCols. Default 2.

baseSize

Numeric. The base font size for all text. Default 12. Can be overwritten by titleSize, axisSize, and axisLabelSize, legendSize, legendTitleSize. Default 8.

combinePlot

Must be either "all", "sample", or "none". "all" will combine all plots into a single .ggplot object, while "sample" will output a list of plots separated by sample. Default "all".

xlab

Character vector. Label for x-axis. Default NULL.

ylab

Character vector. Label for y-axis. Default NULL.

dim1

See plotSCEDimReduceColData. Default NULL.

dim2

See plotSCEDimReduceColData. Default NULL.

labelClusters

Logical. Whether the cluster labels are plotted. Default FALSE.

clusterLabelSize

Numeric. Determines the size of cluster label when labelClusters is set to TRUE. Default 3.5.

defaultTheme

Logical. Adds grid to plot when TRUE. Default TRUE.

dotSize

Numeric. Size of dots. Default 0.5.

transparency

Numeric. Transparency of the dots, values will be from 0 to 1. Default 1.

titleSize

Numeric. Size of title of plot. Default 15.

axisLabelSize

Numeric. Size of x/y-axis labels. Default NULL.

axisSize

Numeric. Size of x/y-axis ticks. Default NULL.

legendSize

Numeric. Size of legend. Default NULL.

legendTitleSize

Numeric. Size of legend title. Default NULL.

Value

ggplot object of the combination of UMAPs. See description.

See Also

runSoupX

Examples

## Not run: 
sce <- importExampleData("pbmc3k")
sce <- runSoupX(sce, sample = "sample")
plotSoupXResults(sce, sample = "sample")

## End(Not run)

compbiomed/singleCellTK documentation built on Oct. 27, 2024, 3:26 a.m.