This script will generate one (or more) bar charts of the intensity of each parameter / channel from a flow or mass cytometry dataset (FCS file).
e.g.
Requirements:
In addition, you will need to install the relevant packages (FlowCore, ggplot2, svdialogs, tidyverse) using the install.packages("packagename") command, which is not included in the script.
UPDATE - Added installing (if required) and loading libraries to top of script.
This script will:
- Read in a specified FCS file opened with a dialogue window.
- Determine an approximate "cutoff" value for mass cytometry data - this is very roughly the point at which we consider values to be potentially lost in the noise of irrlevant markers - e.g. common contaminants such as I 127 / Pb 208. This is considered to be around 20k DC (dual counts) in solution mode (e.g. 1 second acquisition).
- Plot a single graph of all markers.
- If there are markers below the cutoff, it will show a second. If there are markers above the cutoff, it will plot a third.
- Colour-code the bars according to the CV of the intensity. e.g. if the intensity is highly varied (spread around from low to high), the bars will show as purple / red.
- Place a frequency above the bar. e.g. if all events include that parameter / channel, this will be 100%.
- Title the chart with the filename, the cutoff value used and the number of markers.
How I learned to do this:
I'm totally new to programming in R and very new to flow / mass cytometry.
The following links were incredibly useful for getting the code up and running:
- A very simple script to import some FCS data and plot it
- An incredibly complex CyTOF workflow with some snippets I could understand and implement
- A lot of this!
Feedback / suggestions appreciated.