Skip to content

Commit

Permalink
Merge pull request #8 from AllenInstitute/readoutOrderSmELT
Browse files Browse the repository at this point in the history
readoutOrderSmELT
  • Loading branch information
yilinzhao1615 authored Feb 18, 2020
2 parents ffcde27 + 6870840 commit 39d55b9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions probe_construction/MERFISHProbeDesign.m
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,8 @@ function MERFISHProbeDesign(varargin)
allOligos = [];
lastGene = '';

Genes={};
ProbeNumbers={};
%if keepAllPossibleProbes
% allHeaders = cell(sum(vertcat(finalTargetRegions.numRegions)), 1);
% allSeqs = cell(sum(vertcat(finalTargetRegions.numRegions)), 1);
Expand Down Expand Up @@ -1215,14 +1217,15 @@ function MERFISHProbeDesign(varargin)
localReadouts(2).Sequence = '';
localReadouts(3).Header = '';
localReadouts(3).Sequence = '';
longSide = 0;

% 2-hot readout testing, smELT style
elseif (sum(barcodes(i, :)) == 2)
localReadouts(1) = possibleReadouts(1);
localReadouts(2).Header = '';
localReadouts(2).Sequence = '';
localReadouts(3) = possibleReadouts(2);

longSide = 0;
else

if readoutPermuteBySequence
Expand Down Expand Up @@ -1315,6 +1318,9 @@ function MERFISHProbeDesign(varargin)
indsToKeepForReal = indsToKeepForReal(randperm(length(indsToKeepForReal), min([length(indsToKeepForReal) numProbesPerGene])));
display(['... keeping ' num2str(length(indsToKeepForReal)) ' probes']);
fprintf(logFID, '%s - Retaining %d probes\n', datestr(datetime), length(indsToKeepForReal));
%write the genename
Genes=[Genes,localGeneName];
ProbeNumbers=[ProbeNumbers,length(indsToKeepForReal)];

% Check on number
if length(indsToKeepForReal) < numProbesPerGene
Expand Down Expand Up @@ -1415,15 +1421,19 @@ function MERFISHProbeDesign(varargin)
fastawrite(possibleOligosPath, oligos);
display(['... completed in ' num2str(toc(writeTimer))]);
fprintf(logFID, '%s - Completed in %d s\n', datestr(datetime), toc(writeTimer));

%%%%%Write out how many probes per gene as a table
Genes=Genes'
ProbeNumbers=ProbeNumbers'
writetable(table(Genes,ProbeNumbers),[analysisSavePath 'probesPerGeneMergedCode.csv'],'WriteRowNames',false)

if keepAllPossibleProbes
if obj.debugMode
assignin('base', 'allHeaders', allHeaders);
assignin('base', 'allSeqs', allSeqs);
end

allSeqs(cellfun(@isempty, allHeaders)) = [];
allHeaders(cellfun(@isempty, allHeaders)) = [];
%allSeqs(cellfun(@isempty, allHeaders)) = [];
%allHeaders(cellfun(@isempty, allHeaders)) = [];

%allOligos = cell2struct([allHeaders, allSeqs], {'Header', 'Sequence'}, 2);

Expand Down

0 comments on commit 39d55b9

Please sign in to comment.