Attention: Confluence is not suitable for the storage of highly confidential data. Please ensure that any data classified as Highly Protected is stored using a more secure platform.
If you have any questions, please refer to the University's data classification guide or contact ict.askcyber@sydney.edu.au

Skip to end of banner
Go to start of banner

Cytometry Data Analysis

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 29 Next »

This page is currently under construction - check back soon!

Software that we may utilise in different workflows (or access ARGUS for a desktop pre-installed with software)

  1. Download and install R (latest stable version, or a specific version if needed) from here - https://www.r-project.org/
  2. Download and install RStudio Desktop from here - https://www.rstudio.com/products/rstudio/#Desktop
  3. Download and install Rtools (for package building from GitHub repositories) - https://cran.r-project.org/bin/windows/Rtools/
  4. Download and install devtools (for package building from GitHub repositories - install.packages("devtools")
  5. Download and install FlowJo from here (and organise a licence if you haven't already got one)
  6. Download and install SeqGeq from here (and organise a licence if you haven't already got one)
  7. Download and install Matlab
SoftwareAdvantagesDisadvantagesCost
R

Fast

Opensource

HPC

Great community

Scalable to large datasets

Most automated population clustering options

Learning curve

Support is from the community

FREE
RStudio

Same as R but with freiendlier 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

Cumbersome to implement new advanced analysis methods$$
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)

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

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

  1. Basic intro to R - https://cran.r-project.org/doc/contrib/Torfs+Brauer-Short-R-Intro.pdf
  2. Introduction to flowCore - https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-10-106
  3. R package vigenettes (which are the mini guides for each package developed in R)
  4. Flow Cytometry Bioinformatics 2013 - https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3867282/

Data pre-processing in FlowJo using R plugins


FlowJo check sample quality

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

FlowJo also provides access to 2 active cytometry data quality plugins. FlowClean & FlowAI

To enable FlowAI

  • Have R installed (version >3.4)
  • Install BioConductor & flowCore
    • source("https://bioconductor.org/biocLite.R")
    • biocLite()
    • biocLite("flowCore")
  • Install PNG package
    • install.packages("png")
  • Install flowAI
    • biocLite("flowAI")
  • Install stringi (I required this package additionally)
    • biocLite("stringi")
  • Load libraries in R
    • library(flowCore)
      library(stringi)
      library(flowAI)
  • Have FlowJo installed with the correct R path in the preferences
  • If not already present, download and move FlowAI.jar file into the FlowJo plugins folder (available from the FlowJo exchange)
  • Restart FlowJo
  • Select sample and navigate to Plugins, FlowAI. Select parameters and compute. Example output is shown below including layout depiction.

Active sample quality check - FlowClean in FlowJo

To enable FlowClean

  • 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

Please note I am no expert in R/RStudio and apologise in advance if my nomenclature or the below has errors.This is still under construction so please email me and we can update this guide ASAP.

  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. Some basic packages/libraries should be installed while working with flow data, this list isn't comprehensive but it contains some useful basics. 

    source("https://bioconductor.org/biocLite.R")
    biocLite()
    biocLite("FlowSOM",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("flowCore",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("flowViz",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("flowUtils",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("geneplotter",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("Seurat",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("stringi",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("yaml",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("dplyr",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("openCyto",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("tsne",dependencies=TRUE,suppressUpdates=TRUE)
    biocLite("Rtsne",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)
    
    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.

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

    #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")
  5. Examples to try...
    flowClust workflow in vignette
    flowSOM workflow in vignette 
    openCyto workflow in vignette
    Rtsne - https://github.com/lmweber/FlowSOM-Rtsne-example


  6. 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


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






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. 



  • No labels