Skip to content

Commit

Permalink
Merge pull request TASBE#10 from jakebeal/master
Browse files Browse the repository at this point in the history
add bead channel selection option
  • Loading branch information
jakebeal authored May 22, 2017
2 parents cfbee33 + c68e4ed commit 4fb6c1d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions @ColorModel/beads_to_mefl_model.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@
k_MEFL = 10^constrained_fit;
else % 1 peak
warning('TASBE:Beads','Only one bead peak found, assuming brightest');
fit_error = 0; first_peak = 8;
k_MEFL = PeakMEFLs(7)/peak_means;
fit_error = 0; first_peak = numel(PeakMEFLs);
k_MEFL = PeakMEFLs(end)/peak_means;
end;

% Optional plot
Expand Down
10 changes: 10 additions & 0 deletions @ColorModel/set_bead_channel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
% Copyright (C) 2010-2017, Raytheon BBN Technologies and contributors listed
% in the AUTHORS file in TASBE analytics package distribution's top directory.
%
% This file is part of the TASBE analytics package, and is distributed
% under the terms of the GNU General Public License, with a linking
% exception, as described in the file LICENSE in the TASBE analytics
% package distribution's top directory.

function CM=set_bead_channel(CM, v)
CM.bead_channel=v;
6 changes: 6 additions & 0 deletions @PlasmidExpressionModel/PlasmidExpressionModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@

%%%% GAUSSIAN MIXTURE MODEL METHOD
which = cfp_data>drop_threshold;
if(sum(which)==0)
warning('Model:CFPDistributionSeparation','No data to model');
PEM=class(PEM,'PlasmidExpressionModel');
return;
end

% Seeded centers: [8], [5 8], [5 6.5 8], [5 6 7 8], ...
min_center = log10(getMeanMEFL(CFP_af));
if n_components == 1,
Expand Down
10 changes: 6 additions & 4 deletions compute_sample_statistics.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@
if numel(data),
tmp_PEM = PlasmidExpressionModel(data(:,k),CFP_af,CFP_noise,getMEFLPerPlasmid(analysisParams),drop_threshold,n_components);
dist = get_fp_dist(tmp_PEM);
sortable = zeros(n_components,3);
sortable(:,1) = dist.mu; sortable(:,2) = dist.Sigma(:); sortable(:,3) = dist.weight;
sortrows(sortable);
popcmeans(:,k) = sortable(:,1); popcstds(:,k) = sortable(:,2); popcweights(:,k) = sortable(:,3);
if ~isempty(dist)
sortable = zeros(n_components,3);
sortable(:,1) = dist.mu; sortable(:,2) = dist.Sigma(:); sortable(:,3) = dist.weight;
sortrows(sortable);
popcmeans(:,k) = sortable(:,1); popcstds(:,k) = sortable(:,2); popcweights(:,k) = sortable(:,3);
end
if k==c_index, PEM = tmp_PEM; end;
end
end
Expand Down
3 changes: 2 additions & 1 deletion fcs_scatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
if linear(2), yv = yc; else yv = log10(yc(pos)); end;

if nargin >= 4 && density
smoothing = 10;
h = figure('PaperPosition',[1 1 5 5]);
if ~visible, set(h,'visible','off'); end;
if nargin < 5, range = []; end;
if density >= 1, type = 'image'; else type = 'contour'; end
smoothhist2D([xv yv],10,[200, 200],[],type,range,largeoutliers);
smoothhist2D([xv yv],smoothing,[200, 200],[],type,range,largeoutliers);
else
h = figure('PaperPosition',[1 1 5 5]);
if ~visible, set(h,'visible','off'); end;
Expand Down

0 comments on commit 4fb6c1d

Please sign in to comment.