Skip to content

Commit

Permalink
Merge pull request #1 from jakebeal/master
Browse files Browse the repository at this point in the history
pull updated examples and FCS files
  • Loading branch information
jakebeal authored Mar 1, 2017
2 parents 71677af + 2799489 commit a849d4c
Show file tree
Hide file tree
Showing 35 changed files with 41 additions and 35 deletions.
21 changes: 11 additions & 10 deletions 01_flow_cytometry/exercises.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
% Preliminaries: set up TASBE analytics package:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% addpath('~/cur_proj/SynBioIRAD/TASBE_Analytics/');
% example: addpath('~/Downloads/TASBEFlowAnalytics/');
addpath('your-path-to-analytics');
% turn off sanitized filename warnings:
warning('off','TASBE:SanitizeName');

colordata = '../../colortest/';
dosedata = '../../plasmidtest/';
colordata = '../example_controls/';
dosedata = '../example_assay/';



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Examples of flow data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% pure scatter
% pure scatter - often hard to interpret
fcs_scatter([dosedata 'LacI-CAGop_C4_C04_P3.fcs'],'PE-Tx-Red-YG-A','Pacific Blue-A',0,[0 0; 6 6],1);
fcs_scatter([colordata '07-29-11_EYFP_P3.fcs'],'FITC-A','Pacific Blue-A',0,[0 0; 6 6],1);
% smoothed density plot
% smoothed density plot omits details but often summarizes collective better
data1 = fcs_scatter([dosedata 'LacI-CAGop_C4_C04_P3.fcs'],'PE-Tx-Red-YG-A','Pacific Blue-A',1,[0 0; 6 6],1);
data2 = fcs_scatter([colordata '07-29-11_EYFP_P3.fcs'],'FITC-A','Pacific Blue-A',1,[0 0; 6 6],1);

Expand Down Expand Up @@ -68,15 +68,16 @@

data(data(:,7)>260000,7)
% ans = 262143
% How high was this really? We cannot know...
% How high was this really? We cannot know because it is saturated!




channels = {};
channels{1} = Channel('', 'Pacific Blue-A', '',234,456);
channels{2} = Channel('', 'PE-Tx-Red-YG-A', '',890,123);
channels{3} = Channel('', 'FITC-A', '',789,345);

channels{1} = Channel('Pacific Blue-A', 405, 450, 50);
channels{2} = Channel('PE-Texas Red-A', 561, 610, 20);
channels{3} = Channel('FITC-A', 488, 530, 30);
CM = ColorModel('','',channels,{{},{},{}},{});

filtered = read_filtered_au(CM,[colordata '07-29-11_EYFP_P3.fcs']);
Expand All @@ -88,4 +89,4 @@
xc = dequantized(:,10); yc = dequantized(:,11);
pos = xc>0 & yc>0;
figure; smoothhist2D(log10([xc(pos) yc(pos)]),10,[200, 200],[],'image',[0 0; 6 6]);
% quantization gets smoothed out by introduction of small noise
% if desired, quantization can be smoothed out by introduction of small noise
37 changes: 18 additions & 19 deletions 02_flow_compensation/exercises.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
% Preliminaries: set up TASBE analytics package:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% addpath('~/cur_proj/SynBioIRAD/TASBE_Analytics/');
% example: addpath('~/Downloads/TASBEFlowAnalytics/');
addpath('your-path-to-analytics');
% turn off sanitized filename warnings:
warning('off','TASBE:SanitizeName');

colordata = '../../colortest/';
dosedata = '../../plasmidtest/';
colordata = '../example_controls/';
dosedata = '../example_assay/';



Expand Down Expand Up @@ -38,17 +38,23 @@
[raw hdr data] = fca_readfcs([colordata '07-29-11_blank_P3.fcs']);
% histogram of EBFP2:
figure; hist(data(:,10),100);
% with randomization:
% with random blurring to damp quanization:
figure; hist(data(:,10)+(rand(size(data(:,10)))-0.5),100);
% Notice that the presence of negative values means that we are necessarily dealing with a combination
% of autofluorescence and read error. We currently don't know how to separate these from one another.
% of autofluorescence and instrument error. There is not currently any elegant way of separating these.

% fit to a gaussian model:
mean(data(:,10))
std(data(:,10))
mu = mean(data(:,10))
sigma = std(data(:,10))

% Notice that the fit is pretty good:
range = -100:5:150;
figure;
plot(range,histc(data(:,10),range),'b-'); hold on;
plot(range,numel(data(:,10))*5*normpdf(range,mu,sigma),'r--');


% we can simulate a distribution as a sum of three terms: random (bled) signal, autofluorescence, and read error
% we can simulate a distribution as a sum of three terms: random (bleed) signal, autofluorescence, and read error
% here are some arbitrary values to explore as an example:
n = 1e5;
signal = 10.^(randn(n,1)*1+2.5);
Expand Down Expand Up @@ -85,24 +91,25 @@
blankfile = [colordata '2012-03-12_blank_P3.fcs'];

channels = {}; colorfiles = {};
channels{1} = Channel('Pacific Blue-A', 405,0,0);
channels{1} = Channel('Pacific Blue-A', 405,450,50);
channels{1} = setPrintName(channels{1},'Blue');
colorfiles{1} = [colordata '2012-03-12_ebfp2_P3.fcs'];
channels{2} = Channel('PE-Tx-Red-YG-A', 561,610,20);
channels{2} = setPrintName(channels{2},'Red');
colorfiles{2} = [colordata '2012-03-12_mkate_P3.fcs'];
channels{3} = Channel('FITC-A', 488,515,20);
channels{3} = Channel('FITC-A', 488,530,30);
channels{3} = setPrintName(channels{3},'Yellow');
colorfiles{3} = [colordata '2012-03-12_EYFP_P3.fcs'];

colorpairfiles = {};
CM = ColorModel(beadfile, blankfile, channels, colorfiles, colorpairfiles);
CM = set_FITC_channel_name(CM, 'FITC-A'); % We'll explain this in the next exercise
settings = TASBESettings();

% Now let's read some files...
raw = read_filtered_au(CM,[dosedata 'LacI-CAGop_C3_C03_P3.fcs']);
compensated = readfcs_compensated_au(CM,[dosedata 'LacI-CAGop_C3_C03_P3.fcs'],0,1);
% oops! Need to resolve our color model first!
% You should see an error: need to "resolve" the color model first!

CM = resolve(CM,settings);

Expand Down Expand Up @@ -163,11 +170,3 @@

% An important question for the future:
% We need to be able to set error bars on the data points that we correct. Can we?








13 changes: 7 additions & 6 deletions 03_flow_MEFL/exercises.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
% Preliminaries: set up TASBE analytics package:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% addpath('~/cur_proj/SynBioIRAD/TASBE_Analytics/');
% example: addpath('~/Downloads/TASBEFlowAnalytics/');
addpath('your-path-to-analytics');
% turn off sanitized filename warnings:
warning('off','TASBE:SanitizeName');

colordata = '../../colortest/';
dosedata = '../../plasmidtest/';
colordata = '../example_controls/';
dosedata = '../example_assay/';



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Calibration beads:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Let's look at an example of RCP-30-5A calibration beads:
% Let's look at an example of SpheroTech RCP-30-5A calibration beads:
fcs_scatter([colordata '2012-03-12_Beads_P3.fcs'],'Pacific Blue-A','PE-Tx-Red-YG-A',1,[0 0; 6 6],1);
% and without blending...
fcs_scatter([colordata '2012-03-12_Beads_P3.fcs'],'Pacific Blue-A','PE-Tx-Red-YG-A',0,[0 0; 6 6],1);
Expand Down Expand Up @@ -52,13 +52,13 @@
blankfile = [colordata '2012-03-12_blank_P3.fcs'];

channels = {}; colorfiles = {};
channels{1} = Channel('Pacific Blue-A', 405,0,0);
channels{1} = Channel('Pacific Blue-A', 405,450,50);
channels{1} = setPrintName(channels{1},'Blue');
colorfiles{1} = [colordata '2012-03-12_ebfp2_P3.fcs'];
channels{2} = Channel('PE-Tx-Red-YG-A', 561,610,20);
channels{2} = setPrintName(channels{2},'Red');
colorfiles{2} = [colordata '2012-03-12_mkate_P3.fcs'];
channels{3} = Channel('FITC-A', 488,515,20);
channels{3} = Channel('FITC-A', 488,530,30);
channels{3} = setPrintName(channels{3},'Yellow');
colorfiles{3} = [colordata '2012-03-12_EYFP_P3.fcs'];

Expand All @@ -69,6 +69,7 @@

CM = ColorModel(beadfile, blankfile, channels, colorfiles, colorpairfiles);
settings = TASBESettings();
CM = set_FITC_channel_name(CM, 'FITC-A'); % Name the channel we'll use for MEFL units
CM=set_dequantization(CM, 1); % important at low levels
CM=set_bead_plot(CM, 2); % 2 = show beads for all channels, even though only FITC will be used
CM=set_bead_min(CM, 1); % Don't consider beads less than this amount
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ This tutorial has three units:
1. How Flow Cytometry Works
2. Autofluorescence and Compensation in Cells
3. From Arbitrary to Absolute Units

Example code in this tutorial is distributed, insofar as possible, in
the public domain.

Example flow cytometry files are provided courtesy of Prof. Ron Weiss (MIT).
Binary file added example_assay/LacI-CAGop_B10_B10_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B11_B11_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B12_B12_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B3_B03_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B4_B04_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B5_B05_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B6_B06_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B7_B07_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B8_B08_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_B9_B09_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_C1_C01_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_C2_C02_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_C3_C03_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-CAGop_C4_C04_P3.fcs
Binary file not shown.
Binary file added example_assay/LacI-Hef1a-mkate_A3_A03_P3.fcs
Binary file not shown.
Binary file added example_controls/07-29-11_A_006_P3.fcs
Binary file not shown.
Binary file added example_controls/07-29-11_B_006_P3.fcs
Binary file not shown.
Binary file added example_controls/07-29-11_C_006_P3.fcs
Binary file not shown.
Binary file added example_controls/07-29-11_EBFP2_P3.fcs
Binary file not shown.
Binary file added example_controls/07-29-11_EYFP_P3.fcs
Binary file not shown.
Binary file added example_controls/07-29-11_blank_P3.fcs
Binary file not shown.
Binary file added example_controls/07-29-11_mkate_P3.fcs
Binary file not shown.
Binary file added example_controls/2012-03-12_Beads_P3.fcs
Binary file not shown.
Binary file added example_controls/2012-03-12_EBFP2_EYFP_P3.fcs
Binary file not shown.
Binary file added example_controls/2012-03-12_EBFP2_mkate_P3.fcs
Binary file not shown.
Binary file added example_controls/2012-03-12_EYFP_P3.fcs
Binary file not shown.
Binary file added example_controls/2012-03-12_blank_P3.fcs
Binary file not shown.
Binary file added example_controls/2012-03-12_ebfp2_P3.fcs
Binary file not shown.
Binary file not shown.
Binary file added example_controls/2012-03-12_mkate_EYFP_P3.fcs
Binary file not shown.
Binary file added example_controls/2012-03-12_mkate_P3.fcs
Binary file not shown.

0 comments on commit a849d4c

Please sign in to comment.