Dimensionality Reduction and Visualization for Flow Cytometry
- A demo version of this branch can be found on my website Kroll.Bio. This verison is limited to demo files only. This is just for demonstration on how CytoDRAV works so I have restricted it to files that are not large and can be quick to compute.
- Color plot by density of points.
- Sometimes it's useful to visually see where the high density regions of a tSNE plot are. This plotting option shows you this in a familiar blue to red scale for increasing density.
- Moved plot settings and download buttons into a dropdown menu. Helps to give the actual plot more screen real estate.
- I've been working on cleaning up the code in the following ways:
CytoDRAV::launch_application()now defaults to launching your default browser. You can passlaunch.browser=Fif you want to start it but not open a browser. A local link in the formListening on http://127.0.0.1:XXXXwill display. This is the link to the CytoDRAV page.- Renaming variables to more accurately convey what data they hold
- Converting all variables and functions to snake_case. I am beginning to refresh my python knowledge and that is the accepted style there so I will continue it here.
- Commenting all code blocks. No more chunks of code without a small descriptor on what that chunk does.
Enable OpenMP support. Rtsne takes an optional parametersAdded 2019-0505num_threadsInitial testing gives errors, which I believe are due to the fact that I am launching the Rtsne call on a separate thread than the main CytoDRAV application. I will need to test this a lot to see if I can narrow down the error.- More options for plot aesthetics. Many people (our lab included) prefer to add figure legends and text using software such as GraphPad Prism. I will be adding options for the following:
Hide: legend, title, axis labelsAdded 2019-05-05- Modify: axis tick and tick label font size; plot background color
- There is a package that adds in shiny widgets which I think might be useful for the figure update. This would allow you to change the settings from a small widget icon instead of switching between tabs
If you are on a linux system please skip to step 2. Tested on R-3.4.4 on Mac OS, R-3.6.0 on Linux Mint 18 and Windows 10. On Windows 10 it appears all features work EXCEPT the bulk export of plots. I will be working on that.
-
Launch a terminal session (⌘ + spacebar -> "terminal") and check to see if XCode Command Line tools are installed by running the following command
xcode-select --installYou will either see a statement:
xcode-select: error: command line tools are already installed, use "Software Update" to install updatesor a window will pop-up prompting you to install the command line tools. Complete this installation before proceeding.
-
Install R by downloading the R package here. (CytoDRAV should work with any R >= 3.4.4) Then in the terminal you already have open, run the command
R. This will start an interactive R session. Run the following commands to install devtools and CytoDRAVif(!require(devtools)) install.packages("devtools") # If not already installed devtools::install_github("ReevesLab/CytoDRAV", ref="Development", force=T, dependencies=T)This command will progress through the required packages. It may prompt you for input, please select accordingly and make sure that if it asks for you to install Bioconductor, select
yesThis will install CytoDRAV and all required packages.
-
Exit the R session by typing
q()and then enteringnand return. -
In the terminal enter the following lines, hitting return after each line:
cd ~/Desktop printf '#!/bin/bash\nR -e "CytoDRAV::launch_application()"' > RunCytoDRAV chmod +x RunCytoDRAV -
You can now run CytoDRAV but double clicking the
RunCytoDRAVscript. This will launch a terminal window for progress and it will launch your default browser to the CytoDRAV page.- Alternatively you can open a new terminal and enter the following command to launch CytoDRAV
R --slave --no-restore -e "CytoDRAV::launch_application()"
- Alternatively you can open a new terminal and enter the following command to launch CytoDRAV
CytoDRAV works best with 100,000 events and under. You can use more but it exponentially increases time to compute and the time to plot increases drastically. To downsample events you can either pre-downsample in FlowJo, or under the Settings tab there is a slider at the bottom to choose number of events. 10,000 events is fairly quick to compute just to demonstrate the program.