The 3D TSNE application helps users in identifying clusters that exist in their data(eg single cell RNASeq). Previously a version of this application was hosted in NIDAP using Slate but was only able to display 10k data points. For many single cell analysis, the studies contains much larger number of cell ~100K and increasing. Rare cell populations might not be detected if the data is downsampled. The goal of this Shiny application is to be able to display over 100K data points.
- Users are able to plot 100K+ points
- Funtional R- shiny App to plot points and enable lasso capability
- Import and Export data to NIDAP
- To project a 3D view onto 2D we required 3 matrices(model, projection, view). Using plotly.js allows us to get those parameters, while using plotly library in R does not. As a work around, the plotly.js script was read into the shiny app and used to create the 3D scatter plot. JS code was then run was get the parameters. After all the points are transformed, the plotly library in R was then used to plot 2D scatter plot and to lasso points.
- Since the 3D plot is using plotly.js and the 2d is back to using plotly library in R, there are color mismatch between the 2 plots
- To get the projection from 3D view onto 2D view, the user would have to click 2 seperate button instead of 1. the first click is to get the parameters, while the second click is to start projecting onto 2D.
matrix_functions.R File contains 2 functions that this app uses to project 3D onto 2D, they are:
- xformMatrix
- projectVertex
Together they project each x,y,z datapoint onto x, y plane, point by point. So depending on how many datapoints are being ploted, this transformation from 3D to 2D could take a while. A progress bar has since been added to track how far along the transformation is.
js_code.js file contains the js script that is used to plot the 3D scatter plot using plotly.js with shinyjs.
These were the datasets used during the testing phase, they are all currently hosted in NIDAP.
- Move App away from Slate and into R Shiny
- create 3D scatter plot using Plotly with test datasets
- Add ability to customize marker size and shape as well as select annotation column and factors to includes
- Use Plotly.js to create 3d plot
- create simple 3d plot
- create plot using sample dataset
- update axis variables
- update marker size and shape
- update color
- Project 3d view onto 2d plane
- change xformMatrix and projectVertex function code from javascript into R
- get model, view, and projection matrix
- generate 2d plot with transformed points
- Figure out lasso in 2d plot and export points
- Optimize for 100k+ points for lasso
- Add progress bar to track the current progress of projecting to 2d
- testing phase
noop