You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,12 @@
1
-
## CytoSimplex 0.1.99
1
+
## CytoSimplex 0.2.0
2
2
3
3
- Added support for coloring dots by categorical or continuous variable, with options to use customized or built-in color palettes.
4
4
- Changed interactive 3D support of quaternary simplex plot from *rgl* to *plotly*. Now the default is `interactive = TRUE` for `plotQuaternary()` and it returns a `plotly` object.
5
5
- Added interactive support for ternary simplex plot, using plotly, triggered with `interactive = TRUE`
6
6
- Fixed wilcoxon bug
7
7
- Added `readH5ADObsNames()`, `readH5ADObsVar()`, `readH5ADUnsSpMat()`, `readVelocytoLoom()` for loading commonly seen necessary information from H5AD and LOOM files of RNA velocity analysis
8
8
- Added example tutorial for HSPC analysis in the manuscript
Copy file name to clipboardExpand all lines: vignettes/CytoSimplex.Rmd
+18-9Lines changed: 18 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Simplex Visualization of Cell Fate Similarity in Single-Cell Data"
3
3
author: "Yichen Wang, Jialin Liu"
4
-
date: "2023-05-15"
4
+
date: "2024-04-22"
5
5
output: rmarkdown::html_vignette
6
6
vignette: >
7
7
%\VignetteIndexEntry{Simplex Visualization of Cell Fate Similarity in Single-Cell Data}
@@ -49,14 +49,25 @@ head(stats)
49
49
50
50
## Generating ternary plots
51
51
52
-
`plotTernary()` shows sample similarity in a ternary simplex -- equilateral triangle. The closer a dot, a cell, is to one vertex, the more similar the cell is to the cell cluster(s) the vertex represents. We recommend that users select the top marker genes for each terminal and only use them is the features for calculating the similarity.
52
+
`plotTernary()` shows sample similarity in a ternary simplex -- equilateral triangle. The closer a dot, a cell, is to one vertex, the more similar the cell is to the cell cluster(s) the vertex represents. We recommend that users select the top marker genes for each terminal and only use them as the features for calculating the similarity.
plotTernary(rnaRaw, clusterVar = rnaCluster, vertices = vt.tern, features = gene.tern)
58
58
```
59
59
60
+
>The static figure depends on `ggplot2`, which is widely used for visualization in R. The binary simplex is plotted normally in ggplot 2D coordinates, while for the ternary simplex, the barycentric coordinate is drawn with 2D segments with cartesian coordinate, instead of implementing a ternary barycentric coordinate system. Users wishing to add customized alteration should pay attention to this.
61
+
62
+
### Interactive ternary plot
63
+
64
+
The same figure above can be shown in an interactive panel, powered by [plotly](https://plotly.com/r/). The interactive plot allows users to zoom in and out, and hover over the dots to see the cell names and the values of inferred similarity. To enable this feature, users only need to add `interactive = TRUE` in the function call.
plotTernary(rnaRaw, clusterVar = rnaCluster, vertices = vt.tern, features = gene.tern,
68
+
interactive = TRUE)
69
+
```
70
+
60
71
## Adding velocity information to ternary plot
61
72
62
73
RNA velocity is a quantitative measurement of cellular transitions from single-cell transcriptomics experiments and reveals transient cellular dynamics among a heterogeneous cell population (<ahref="https://www.pnas.org/doi/10.1073/pnas.2105859118"target="_blank">Qiao, PNAS 2021</a>). We implemented a velocity visualization strategy that could be applied to ternary and quaternary simplex plot. The velocity information input format must be an N x N graph (sparse matrix, where N denotes number of cells). We have included a graph that matches with the cells in the example dataset in this package. This graph is a subset of the output from <ahref="https://github.com/welch-lab/VeloVAE"target="_black">Python module `veloVAE`</a>, as part of the processed data from the publication mentioned at the start.
@@ -69,13 +80,13 @@ print(paste0("Class of `rnaVelo`: ", class(rnaVelo),
69
80
70
81
We create a number of square grids in the 2D plain of the ternary simplex (or cube grids in 3D space of the quaternary simplex), and aggregate the cells fall into each grid with taking the mean of velocity towards each of the vertices. Finally, we draw an arrow from the grid center pointing to each vertex with the length representing the aggregated mean velocity.
71
82
83
+
Interactive view with velocity information is also supported. The aggregated potential value can also be shown when hovering above the arrows.
features = gene.tern, veloGraph = rnaVelo, interactive = TRUE)
75
88
```
76
89
77
-
>The previous two functions mainly depends of `ggplot2`, which is widely used to create figures in R. The binary simplex is plotted normally in ggplot 2D coordinates, while for the ternary simplex, the barycentric coordinate is drawn with 2D segments with cartesian coordinate, instead of implementing a ternary barycentric coordinate system. Users wishing to add customized alteration should pay attention to this.
78
-
79
90
## Exploration with each cluster
80
91
81
92
An argument `splitCluster` is supported for all three plotting functions. By setting `splitCluster = TRUE`, A list of plots will be returned, with one containing all cells, and each of the other sub-plots containing only dots (cells) belonging to one cluster in the annotation specified.
@@ -104,9 +115,7 @@ As shown in the subplots, the OCT stem cells has the transitional potential towa
104
115
105
116
## Create quaternary simplex plot
106
117
107
-
`plotQuaternary()` shows sample similarity in a quaternary simplex -- tetrahedron. The 3D visualization depends on package `plot3D` for creating static figure, and `rgl` for creating interactive 3D display. (Linux users may refer to [`rgl` documentation](https://dmurdoch.github.io/rgl/#installing-opengl-support) for installation guide)
108
-
109
-
For a quaternary simplex, we need one more cluster as a vertex. Here, we add the cells annotated as osteoblast-reticular transition cells (`"ORT"`) into the vertex list. We also add the velocity information in this example, as it will not be shown by default.
118
+
For a quaternary simplex, we need one more cluster as a vertex. Here, we add the cells annotated as osteoblast-reticular transition cells (`"ORT"`) into the vertex list. We also add the velocity information in this example, as it will not be shown by default. Note that we provide interactive quaternary plot by default.
The 3D tetrahedron shown is automatically generated with an **interactive** web widget. If a static view is preferred, users can set `interactive = FALSE` in the function call, and adjust the view angle with `theta` and `phi` arguments.
127
+
If a static view is preferred, users can set `interactive = FALSE` in the function call, and adjust the view angle with `theta` and `phi` arguments.
119
128
120
129
We have also implemented of GIF image generator that rotates the tetrahedron rounding the z-axis. Note that package `magick` is required for this feature. (<ahref="https://cran.r-project.org/package=magick/vignettes/intro.html#Installing_magick"target="_blank">See here for how to install `magick` in detail</a>)
0 commit comments