FlowJoBridge

Version 4.0 (4.75 MB) by Connor
An interoperability framework between MATLAB and FlowJo.
13 Downloads
Updated 17 May 2023

View License

This submission provides read/write access to data and population (gate) definitions stored in the workspaces of FlowJo 10.x. FlowJo is the most widely used software for single cell analysis, which is a cornerstone not only of immunology and vaccine research, but also of fields like oceanography and plant research. This submission primarily aims to foster the development of automatic cell population classifiers so as to deprecate the widely adopted practice of manual gating, which is time consuming and frequently subjective.
The function SupervisedGatingOn2MiceStrains in the file fcs/FlowJoBridgeExamples.m illustrates
  • Training MATLAB’s supervised classification tools with a FlowJo workspace’s peer reviewed manual gates.
  • Updating the FlowJo workspace with the gates that this training predicts on other samples
function SupervisedGatingOn2MiceStrains
method=questdlg('Do MATLAB supervised gating with ...',...
'Which method?', 'Discriminant analysis', ...
'Neural network', 'Discriminant analysis');
gating='/Singlets/Live singlets';
workspace=['https://storage.googleapis.com/' ...
'cytogenie.org/GHOSN2.wsp'];
%TRAIN fitcdiscr or fitcnet using the data and 9 parameters
% used to manually gate a representative sample in FlowJo
columns={'FSC-A', 'SSC-A', 'CD5:*', 'CD11b:*', 'F4/80:*', ...
'CD11c-biot:*', 'CD19:*', 'IgD:*', 'IgM:*'};
flowJoURI=['all_3-3.fcs' ... %BALB/c mouse strain
gating '@' workspace];
[data, ~, labels]=FlowJoTree.Read(flowJoURI, columns, 'labels');
if isequal(method, 'Neural network')
training=fitcnet(data, labels, 'Verbose', true, ...
'VerboseFrequency', 25, 'IterationLimit', 100,...
'LayerSizes', [100 50 25], 'Standardize', 1);
else
training = fitcdiscr(data, labels);
end
%NOW use this training to predict populations on a sample from
%a different mouse strain stained by different reagents
flowJoURI=['all_3-4.fcs', ... %genetic knockout strain
gating '@' workspace];
[data, ~, trueLabels,~, ~,~,~,~, gates]...
=FlowJoTree.Read(flowJoURI, columns, 'labels');
predictedLabels=predict(training, data);
%visualize the predictions with MATLAB’s confusion chart
confusionchart(figure, trueLabels, predictedLabels, ...
'Title', {[method ' prediction of cell ' ...
'populations in a RAG mouse'], ...
['strain (lacks B & T cells) from training on a ' ...
'BALB/c mouse strain']});
%write back the predictions into the FlowJo workspace
FlowJoTree.CreateLabelGates([method ' gating'],...
'demoIcon.gif', data, predictedLabels, [], columns, gates);
end
The example calls to fitcnet and fitcdiscr have many other options including auto tuning that the program can explore for each separate dataset.
The submission also provides
  • Much additional functionality that we have developed for the analysis of flow cytometry data.
  • An intuitive GUI that enables the non-programmer to benefit immediately from the power of MATLAB when evaluating and extending FlowJo’s gating definitions.
  • Access to 9 demo workspaces that access the data and gating definitions of recent publications.
To start the GUI and set the MATLAB paths, invoke the “fjb” command from the root folder where you unzip our submission.
This submission complements the functionality of FlowJo, but does not replace it. Data setup and the majority of manual gating must be done in FlowJo and gate definitions can only be adjusted or created in FlowJoBridge for pre-existing X/Y parameter pairings.
This submission is provided by the Herzenberg Lab at Stanford University.
FlowJo is a registered trademark of FlowJo, LLC, a wholly owned subsidiary of Becton, Dickinson and Company (BD). Visit www.flowjo.com for more information about FlowJo. This File Exchange submission is not affiliated with FlowJo, LLC or BD.

Cite As

Connor Meehan, Stephen Meehan, Wayne Moore, and Leonore Herzenberg (2023). FlowJoBridge (https://www.mathworks.com/matlabcentral/fileexchange/<...>), MATLAB Central File Exchange.

MATLAB Release Compatibility
Created with R2023a
Compatible with R2017a to R2023a
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

epp

fcs

mlp

umap

util

Version Published Release Notes
4.0