Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

SoftwareAdvantagesDisadvantagesCost
R

Fast

Opensource

HPC

Great community contribution

Scalable to large datasets

Most automated population clustering options

Learning curve

Support is from the community

FREE
RStudio

Same as R but with freiendlier friendlier user interface

Code can be deployed on HPC

Same as R

Learning curve (less than R due to GUI)

FREE
RToolsUsed to deploy newly published methodsComplicatedFREE
FlowJo

Commercial software

Powerful

Easy to use

Large number of advanced users

Works well

Newer plugins

Cumbersome to implement new advanced analysis methods - has been improved. $$
SeqGeq

Useful for single cell workflows (RNA/DNA)

Commercial software

Powerful

Easy to use

Large number of advanced users

Many automated population clustering options


$$
Matlab

Powerful

Some published workflows use Matlab

Code is easier to understand compared to R (personal advantage, although this will likely change soon)

Available to some USYD students

Flow cytometry analysis community is heavily developing in R compared to Matlab$/Free

Excellent links for information that was used for R/Rstudio/flowCore

...

In FlowJo, after importing your cytometry data, click the 'Check sample quality' button in the tools workspace. This will flag samples that should be checked. FlowJo plots the median values for each parameter over time and flags any that are outside of 2 standard deviations. Green is good. Any thing else should be reviewed. 

Active sample quality check - FlowAI in FlowJo

...

  • Have R installed (version >3.4)
  • Install BioConductor
    • source("https://bioconductor.org/biocLite.R")
    • biocLite("flowCore")
    • biocLite("flowClean")
  • Load libraries in R
    • library(flowCore)
      library(flowClean)
  • Have FlowJo installed with the correct R path in the preferences
  • If not already present, download and move FlowClean.jar file into the FlowJo plugins folder (available from the FlowJo exchange)
  • Restart FlowJo
  • Select sample and navigate to Plugins, FlowClean. Select parameters and compute. Example output is shown below.

Reading and analysing FCS files in R/RStudio

...

- outdated code. 

  1. Open RStudio (ensure you run as administrator, otherwise you may run into permission errors).
  2. Make a new project (a project can be considered a workspace where everything can be saved to)
  3. You want to download and load packages for the analysis that you will be doing (not efficient to load all the libraries, as RStudio is limited to 100, I learnt by experience, to see loaded libraries, type library())
  4. Some basic packages/libraries should be installed while working with flow data, this list isn't comprehensive but it contains some for the workflows listed, you can load the libraries that you will use. 

    Code Block
    #this will download the core Bioconductor packages
    source("https://bioconductor.org/biocLite.R")
    biocLite()
    
    #this will download flowCore (useful core for working with flow data)
    source("https://bioconductor.org/biocLite.R")
    biocLite("flowCore",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download flowUtils (another set of useful tools)
    source("https://bioconductor.org/biocLite.R")
    biocLite("flowUtils",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download flowViz
    source("https://bioconductor.org/biocLite.R")
    biocLite("flowViz",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download flowSOM 
    source("https://bioconductor.org/biocLite.R")
    biocLite("FlowSOM",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download geneplotter 
    source("https://bioconductor.org/biocLite.R")
    biocLite("geneplotter",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download Seurat 
    source("https://bioconductor.org/biocLite.R")
    biocLite("Seurat",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download stringi
    source("https://bioconductor.org/biocLite.R")
    biocLite("stringi",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download yaml 
    source("https://bioconductor.org/biocLite.R")
    biocLite("yaml",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download dplyr
    source("https://bioconductor.org/biocLite.R")
    biocLite("dplyr",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download openCyto 
    source("https://bioconductor.org/biocLite.R")
    biocLite("openCyto",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download tsne 
    source("https://bioconductor.org/biocLite.R")
    biocLite("tsne",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download Rtsne 
    source("https://bioconductor.org/biocLite.R")
    biocLite("Rtsne",dependencies=TRUE,suppressUpdates=TRUE)
    
    #this will download edgeR 
    source("https://bioconductor.org/biocLite.R")
    biocLite("edgeR",dependencies=TRUE,suppressUpdates=TRUE)
    
    install.packages("dplyr",dependencies=TRUE,suppressUpdates=TRUE)
    install.packages("yaml",dependencies=TRUE,suppressUpdates=TRUE) 
    install.packages("devtools",dependencies=TRUE,suppressUpdates=TRUE)
    
    #use this to load downloaded packages
    library(flowCore)
    library(FlowSOM)
    library(flowViz)
    library(flowUtils)
    library(geneplotter)
    library(Seurat)
    library(dplyr)
    library(yaml)
    library(stringi)
    library(openCyto)
    library(tsne)
    library(Rtsne)


    Note: There are many Vignettes in the packages which are ever so helpful. Vignettes are help guides that can help to show you how to use different tools/functions.

  5. Some commonly used codes - good to get familiar with

    Code Block
    #gets to working directory
    getwd()
    #sets the working directory
    setwd('C:/Users/utopi/Desktop/testdata')
    #assign a file to a variable
    fileName <- "C:/Users/utopi/Desktop/testdata/sample.fcs"
    #assign a folder to a variable
    folderName <- "C:/Users/utopi/Desktop/testdata/"
    #read a FCS file to a variable using read.FCS from flowCore
    data1 = read.FCS('A1.fcs')
    #assign a variable an example data file i.e. from a vignette example
    fileName <- system.file("extdata","lymphocytes.fcs",package="FlowSOM")


  6. Examples to try...
    flowClust workflow in vignette
    flowSOM workflow in vignette 
    openCyto workflow in vignette
    Rtsne - https://github.com/lmweber/FlowSOM-Rtsne-example
    https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4980779/
    https://onlinelibrary.wiley.com/doi/full/10.1002/cyto.a.23030  - good comparison paper

    Lets analyse some data..
  7. Put your data in a folder on your computer
  8. In RStudio go to file and then new R script (we will be writing the script so that we can rerun it if needed)
  9. Lets assign the folder to a variable

    Code Block
    folderName <- "C:/Users/USERNAME/Desktop/testdata/"


  10. Lets load the flowSOM package

    Code Block
    #this will download flowSOM 
    source("https://bioconductor.org/biocLite.R")
    biocLite("FlowSOM",dependencies=TRUE,suppressUpdates=TRUE)library(flowSOM)


  11. Lets make the flowSOM object

    Code Block
    fSOM <- FlowSOM(file,
                    # Input options:
                    compensate = TRUE,transform = TRUE,
                    scale = TRUE,
                    # SOM options:(will use parameters 1,4 and 5 thru 7)
                    colsToUse = c(1,4,5:7), xdim = 7, ydim = 7,
                    # Metaclustering options:
                    nClus = 10,
                    # Seed for reproducible results:
                    seed = 42)


  12. Lets view the flowSOM

    Code Block
    PlotStars(fSOM$FlowSOM,backgroundValues = as.factor(fSOM$metaclustering))
    


Specific workflows when dealing with data generated at WRHFlow

MethodUseful for...How toExample image
tSNE - R


tSNE - FlowJo


tSNE - MATLAB


SPADE - R


SPADE - FlowJo


SPADE - MATLAB


Scaffold


Vortex


FlowClust


FlowSOM


CITRUS


SamSPECTRAL


RchyOptimyx


immunoClust



Workflow 1 - Analysing a high parameter single FCS file

This workflow will demonstrate tSNE, SPADE, Scaffold, FlowClust, FlowSOM, VORTEX.

Workflow 2 - Comparing group A to group B
This workflow will demonstrate comparison of samples. 

Thomas Ashhurst over at Sydney Cytometry has compiled a number of other scripts together to put together CAPX for R that automatically generates some pretty tSNE & flowSOM visualisations. 

https://github.com/sydneycytometry/