Flow Cytometry Data Analysis using R 2013

Workshop pages for students

Laptop Setup Instructions

Instructions for setting up your laptop can be found here: Laptop Setup Instructions_FACS

Difference Between R and R Studio

RStudio doesn’t know where libraries are installed, when they are not installed through the RStudio package manager. To tell RStudio the location, you can define the path in a startup file. Create a file called .Renviron . Inside there:

R_LIBS=<R Library Path of other installed packages>

That was the problem when students installed things in R Studio at the command line using the R command install.package().

… or you could use the package manger to install libraries.

Retaining unaltered versions of your variables in R Studio

There may be some memory management issues with R Studio and flow cytometry data. If you encounter a scenario where you start with one variable (flowSet), then copy it into another and alter it (preprocess, transform) and find the original variable also altered, then consider saving and loading your flowSet variable at every stage of alteration that you wish to recall. For example:

fs <- read.flowSet(path = '/home/rguru/Documents/mydata/')

fs <- flowComp(fs) \# function 'flowComp' is provided by Radina in support\_functions.R

save(fs, '/home/rguru/Documents/my\_raw\_fs.RData')

fs.preprocessed <- fs

  • Do a bunch of preprocessing to fs.preprocessed

  • Try to plot fs and fs.preprocessed, find that your ‘fs’ appears to be altered also

  • Instead, re-load the saved version:

load('/home/rguru/Documents/my\_raw\_fs.RData') (note that this will reload a variable called ‘fs’ and replace the current one in your workspace, thereby making the ‘fs’ you work with below the saved one you were hoping to get)

This issue should not occur if using R from a terminal. Also be careful that you did not accidentally re-execute some code a few times and unintentionally actually alter your flowSet.

Pre-Workshop Tutorials

1) R Preparation tutorials: You are expected to have completed the following tutorials in R beforehand. The tutorial should be very accessible even if you have never used R before.

2) UNIX Preparation tutorials:

Pre-Workshop Readings


Data Sets



Day 1


*Faculty: Michelle Brazas*

Module 1: Introduction to Flow Cytometry Analysis in R

*Faculty: Ryan Brinkman*


Module 1 pdf
Module 1 mp4

Module 2: Exploring FCM data in R

*Faculty: Radina Droumeva*


Module 2 pdf‎
Module 2‎ mp4

Lab Practical:

Module 2 Lab
PlottingReference.R - reference, summary and tutorial for plot functions in R.

Module 3: Preprocessing and Quality Assurance of FCM Data

*Faculty: Radina Droumeva*


Module 3‎ pdf
Module 3‎ mp4

Lab Practical:

Module 3 Lab

Integrated Assignment

*Faculty: Radina Droumeva*

Day 2

Module 4: Automated Cell Population Identification

*Faculty: Ryan Brinkman*


Module 4‎ pdf
Module 4‎ mp4

Module 5: 1D Automated Gating

*Faculty: Radina Droumeva*


Module 5‎ pdf
Module 5‎ mp4

Lab Practical:

Module 5 Lab

Module 6: Additional FCM Tools

*Faculty: Ryan Brinkman*


Module 6 pdf‎
Module 6 mp4

Other (more advanced) resources:


More detailed introduction to R. Not a basic tutorial, this is for people who really want to know more about R.



1) “Introductory Statistics with R” by Peter Dalgaard. It is not required for this workshop but if you are interested in buying a good book and/or want to know more, you might want to consider getting a copy.

Section 1-5 give a very good (perhaps very detailed) idea of what I plan to discuss during the workshop.

2) Statistics for Biology and Health by Robert Gentleman, Vincent Carey, Wolfgang Huber, Rafael Irizarry and Sandrine Dudoit

3) Building Bioinformatics Solutions with Perl, R and MySQL by Conrad Bessant, Ian Shadforth and Darren Oakley

View on GitHub