plotQuaternary.SingleCellExperiment {CytoSimplex} | R Documentation |
Create quaternary simplex plot with SingleCellExperiment object
Description
Create quaternary plots that show similarity between single cells and selected four terminals in a baricentric coordinate.
See plotTernary
for more details on methodologies.
A dynamic rotating view in a GIF image file can be created with
writeQuaternaryGIF
. Package magick
must be installed in
advance. Linux users may refer to this
installation guide.
Usage
## S3 method for class 'SingleCellExperiment'
plotQuaternary(
x,
assay.type = "counts",
clusterVar = NULL,
processed = FALSE,
dotColorBy = NULL,
legendTitle = NULL,
...
)
Arguments
x |
A SingleCellExperiment object |
assay.type |
Assay to use for calculating the similarity. Default
|
clusterVar |
A variable name in |
processed |
Logical. Whether the input matrix is already processed.
|
dotColorBy |
A vector/factor for coloring dots, can be either categorical
(must be character or factor) or continuous. Default |
legendTitle |
Title on the legend/colorbar. Default |
... |
Arguments passed on to
|
Value
By default, a "plotly" object. When interactive = FALSE
, a
"quatPlot" object when byCluster
is not specified, or a "list" of
"quatPlot" objects when byCluster
is specified. When
returnData = TRUE
, a list of similarity matrix and aggregated velocity
matrix is returned.
See Also
Other plotQuaternary:
plotQuaternary()
,
plotQuaternary.Seurat()
Examples
# SingleCellExperiment example
if (requireNamespace("SingleCellExperiment", quietly = TRUE)) {
require(SingleCellExperiment)
sce <- SingleCellExperiment(assays = list(counts = rnaRaw))
colLabels(sce) <- rnaCluster
gene <- selectTopFeatures(sce, vertices = c("OS", "RE", "CH", "ORT"))
plotQuaternary(sce, features = gene,
vertices = c("OS", "RE", "CH", "ORT"))
}