A wrapper function which visualizes outputs from the runDecontX function stored in the colData slot of the SingleCellExperiment object via various plots.
plotDecontXResults(
inSCE,
sample = NULL,
bgResult = FALSE,
shape = NULL,
groupBy = NULL,
combinePlot = "all",
violin = TRUE,
boxplot = FALSE,
dots = TRUE,
reducedDimName = "UMAP",
xlab = NULL,
ylab = NULL,
dim1 = NULL,
dim2 = NULL,
bin = NULL,
binLabel = NULL,
defaultTheme = TRUE,
dotSize = 0.5,
summary = "median",
summaryTextSize = 3,
transparency = 1,
baseSize = 15,
titleSize = NULL,
axisLabelSize = NULL,
axisSize = NULL,
legendSize = NULL,
legendTitleSize = NULL,
relHeights = 1,
relWidths = c(1, 1, 1),
plotNCols = NULL,
plotNRows = NULL,
labelSamples = TRUE,
labelClusters = TRUE,
clusterLabelSize = 3.5,
samplePerColumn = TRUE,
sampleRelHeights = 1,
sampleRelWidths = 1
)
Input SingleCellExperiment object with saved dimension reduction components or a variable with saved results from runDecontX. Required.
Character vector. Indicates which sample each cell belongs to. Default NULL.
Boolean. If TRUE, will plot decontX results generated with raw/droplet matrix Default FALSE.
If provided, add shapes based on the value.
Groupings for each numeric value. A user may input a vector equal length to the number of the samples in the SingleCellExperiment object, or can be retrieved from the colData slot. Default NULL.
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".
Boolean. If TRUE, will plot the violin plot. Default TRUE.
Boolean. If TRUE, will plot boxplots for each violin plot. Default TRUE.
Boolean. If TRUE, will plot dots for each violin plot. Default TRUE.
Saved dimension reduction name in the SingleCellExperiment object. Required. Default = "UMAP"
Character vector. Label for x-axis. Default NULL.
Character vector. Label for y-axis. Default NULL.
1st dimension to be used for plotting. Can either be a string which specifies the name of the dimension to be plotted from reducedDims, or a numeric value which specifies the index of the dimension to be plotted. Default is NULL.
2nd dimension to be used for plotting. Can either be a string which specifies the name of the dimension to be plotted from reducedDims, or a numeric value which specifies the index of the dimension to be plotted. Default is NULL.
Numeric vector. If single value, will divide the numeric values into the `bin` groups. If more than one value, will bin numeric values using values as a cut point.
Character vector. Labels for the bins created by the `bin` parameter. Default NULL.
Removes grid in plot and sets axis title size to 10 when TRUE. Default TRUE.
Size of dots. Default 0.5.
Adds a summary statistic, as well as a crossbar to the violin plot. Options are "mean" or "median". Default NULL.
The text size of the summary statistic displayed above the violin plot. Default 3.
Transparency of the dots, values will be 0-1. Default 1.
The base font size for all text. Default 12. Can be overwritten by titleSize, axisSize, and axisLabelSize, legendSize, legendTitleSize.
Size of title of plot. Default NULL.
Size of x/y-axis labels. Default NULL.
Size of x/y-axis ticks. Default NULL.
size of legend. Default NULL.
size of legend title. Default NULL.
Relative heights of plots when combine is set.
Relative widths of plots when combine is set.
Number of columns when plots are combined in a grid.
Number of rows when plots are combined in a grid.
Will label sample name in title of plot if TRUE. Default TRUE.
Logical. Whether the cluster labels are plotted. Default FALSE.
Numeric. Determines the size of cluster label when `labelClusters` is set to TRUE. Default 3.5.
If TRUE, when there are multiple samples and combining by "all", the output .ggplot will have plots from each sample on a single column. Default TRUE.
If there are multiple samples and combining by "all", the relative heights for each plot.
If there are multiple samples and combining by "all", the relative widths for each plot.
list of .ggplot objects
data(scExample, package="singleCellTK")
sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
sce <- runDecontX(sce)
#> Tue Jun 28 22:04:02 2022 ... Running 'DecontX'
#> --------------------------------------------------
#> Starting DecontX
#> --------------------------------------------------
#> Tue Jun 28 22:04:02 2022 .. Analyzing all cells
#> Tue Jun 28 22:04:02 2022 .... Generating UMAP and estimating cell types
#> Tue Jun 28 22:04:06 2022 .... Estimating contamination
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 10 | converge: 0.0278
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 20 | converge: 0.01058
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 30 | converge: 0.00584
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 40 | converge: 0.004697
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 50 | converge: 0.003356
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 60 | converge: 0.002634
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 70 | converge: 0.001941
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 80 | converge: 0.001413
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 90 | converge: 0.001284
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 100 | converge: 0.00111
#> Tue Jun 28 22:04:06 2022 ...... Completed iteration: 104 | converge: 0.0009827
#> Tue Jun 28 22:04:06 2022 .. Calculating final decontaminated matrix
#> --------------------------------------------------
#> Completed DecontX. Total time: 3.346597 secs
#> --------------------------------------------------
plotDecontXResults(inSCE=sce, reducedDimName="decontX_UMAP")