This document outlines how to set up a flow cytometry dashboard using the flowDashboard
Shiny modules.
knitr::opts_chunk$set(echo = TRUE) #knitr::opts_knit$set(root.dir = "../")
flowDashboard
Fits in an Analysis WorkflowflowDashboard
enables you to visualize data at both the Sample and cell population Level. The package assumes that you either have FCS data in a directory, or have generated a GatingSet
for your gating scheme. This gating scheme can either be automated (from a pipeline such as openCyto
) or manually (imported from flowJo).
There are multiple modules that will enable you to examine each step of the analysis.
Annotation
display - displays annotation for all the FCS files in an experiment.QC
plots - plots that let you compare the overall state of the data before and after preprocessing.Gating
plots - plots that display how the data was gatedDot
plots - to visualize populations based on a covariateViolin
plots of markers in a populationWaterfall
plots to examine how population percentage correlates with an outcome.Coexpression
plots - a heatmap and a two-way expression explorer.Once your data is in a gatingSet
(preferably in ncdf format), we will need to transform and prep it into the data.table
format. This package uses data.table
because it is a very fast format for accessing, merging, sorting, and displaying data.
The annotation structure is another data.table
that we need for the dashboard. Based on your unit of analysis and what the FCS file represents (which may be patients, cell lines, or conditions within a patient), you will need an annotation table that provides covariate information at the level of analysis you are interested in. You can generate the skeleton of an annotation table with the `` command, or you can use the phenoData slot in your GatingSet.
Please note that the usefulness of flowDashboard
is only as good as your annotation. Careful curation of variables in your annotation will allow you to sort, subset, and aggregate on these variables.
library(flowWorkspace) library(flowDashboard) gsFile <- system.file("extdata/gvHDgs/", package = "flowDashboard") gs <- load_gs(gsFile) ##look at phenoData slot in gs phenotypes <- pData(gs@data@phenoData) phenotypes ##look at marker information in gs markerInfo <- pData(parameters(gs@data[[1]])) markerInfo #build a qcFlowObj QCO <- QCOFromGatingSet(gs, samplePop = 1000) #show annotation slot QCO$annotation #show first few lines of qcData QCO$qcData
The QC Heatmap provides a quick overview of how markers vary across populations. This heatmap is based on the idea of examining a QC panel of markers to compare whether there is a large technical variation between samples.
The QC Violin plots allow you to compare fluoresence distibution of individual functions.
The underlying QC data is sampled using the buildSampledDataList()
function. This function generates a data.table that samples from each FCS file for a selected control panel of markers.
The gating module consists of a heatmap visualization and plots for each cell in the heatmap, corresponding to the gating scheme. This module is useful in understanding the impact of automated gating pipelines, such as openCyto
, and comparing manual gating schemes across samples.
The plots for each sample must be precomputed using the plotAllPopulations()
function. This function takes a GatingSet as input.
The Violin plots
This module displays population percentages
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.