plotQuaternary {CytoSimplex} | R Documentation |
Create quaternary simplex plots
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
plotQuaternary(x, ...)
## Default S3 method:
plotQuaternary(
x,
clusterVar,
vertices,
features = NULL,
veloGraph = NULL,
byCluster = NULL,
processed = FALSE,
method = c("euclidean", "cosine", "pearson", "spearman"),
force = FALSE,
sigma = 0.05,
scale = TRUE,
dotColorBy = NULL,
dotColor = NULL,
palette = "D",
direction = 1,
breaks = NULL,
legendTitle = NULL,
returnData = FALSE,
...
)
Arguments
x |
Input data. Can be a |
... |
Arguments passed on to
|
clusterVar |
A vector/factor assigning the cluster variable to each
column of the matrix object. For "Seurat" method, |
vertices |
Vector of three unique cluster names that will be used for plotting. Or a named list that groups clusters as three terminal vertices. There must not be any overlap between groups. |
features |
Valid matrix row subsetting index to select features for
similarity calculation. Default |
veloGraph |
Cell x cell |
byCluster |
Default |
processed |
Logical. Whether the input matrix is already processed.
|
method |
Similarity calculation method. Default |
force |
Whether to force calculate the similarity when more then 500
features are detected, which is generally not recommended. Default
|
sigma |
Gaussian kernel parameter that controls the effect of variance.
Only effective when using a distance metric (i.e. |
scale |
Whether to min-max scale the distance matrix by clusters.
Default |
dotColorBy |
A vector/factor for coloring dots, can be either categorical
(must be character or factor) or continuous. Default |
dotColor |
Character vector of color codes. When |
palette |
Color palette to use when |
direction |
Sets the order of colors in the scale. Default |
breaks |
Number of breaks for continuous color scale passed to
non-interactive "plot3D::scatter3D" call. Default |
legendTitle |
Title on the legend/colorbar. Default |
returnData |
Logical. Whether to return similarity and aggregated
velocity data if applicable instead of generating plot. Default |
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.Seurat()
,
plotQuaternary.SingleCellExperiment()
Examples
gene <- selectTopFeatures(
x = rnaRaw,
clusterVar = rnaCluster,
vertices = c("RE", "OS", "CH", "ORT")
)
plotQuaternary(
x = rnaRaw,
clusterVar = rnaCluster,
vertices = c("RE", "OS", "CH", "ORT"),
features = gene
)