Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fixes to 3D pipeline #17

Open
wants to merge 2 commits into
base: 3D
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions @iss/extract_and_filter.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
end

if (min(size(o.EmptyTiles))==1 && min(o.EmptyTiles)~=0) || ...
(min(size(o.EmptyTiles)==[MaxY, MaxX]) && min(o.EmptyTiles(:))==0 && ...
(min(size(o.EmptyTiles)==[o.MaxY, o.MaxX]) && min(o.EmptyTiles(:))==0 && ...
max(o.EmptyTiles(:)==1))
UsedEmptyTiles = true;
if min(o.EmptyTiles(:))==0
Expand All @@ -113,7 +113,7 @@
end

%Tile index in nd2 file different to index in o.EmptyTiles
t_save_value = sub2ind([MaxY,MaxX],o.TilePosYX(:,1),o.TilePosYX(:,2));
t_save_value = sub2ind([o.MaxY,o.MaxX],o.TilePosYX(:,1),o.TilePosYX(:,2));

o.TilePosYXC = zeros(nSerieswPos*nChannels,3);

Expand Down
4 changes: 2 additions & 2 deletions @iss/extract_and_filter_NoGPU.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
% SE = h2D.*hzdirection;

if (min(size(o.EmptyTiles))==1 && min(o.EmptyTiles)~=0) || ...
(min(size(o.EmptyTiles)==[MaxY, MaxX]) && min(o.EmptyTiles(:))==0 && ...
(min(size(o.EmptyTiles)==[o.MaxY, o.MaxX]) && min(o.EmptyTiles(:))==0 && ...
max(o.EmptyTiles(:)==1))
UsedEmptyTiles = true;
if min(o.EmptyTiles(:))==0
Expand All @@ -129,7 +129,7 @@
end

%Tile index in nd2 file different to index in o.EmptyTiles
t_save_value = sub2ind([MaxY,MaxX],o.TilePosYX(:,1),o.TilePosYX(:,2));
t_save_value = sub2ind([o.MaxY,o.MaxX],o.TilePosYX(:,1),o.TilePosYX(:,2));

%Set top hat structuring elements
if strcmpi(o.DapiR,'auto')
Expand Down
2 changes: 2 additions & 0 deletions @iss/get_TilePos.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
X = uniqueX(diff([0;uniqueX])==1 & uniqueX<=nTiles);
MaxY = max(Y);
MaxX = max(X);
o.MaxX = MaxX;
o.MaxY = MaxY;

%Sometimes get Nan, if only one Nan, then check if all tiles
%arranged along only one direction i.e. Nan should be 1.
Expand Down
11 changes: 10 additions & 1 deletion @iss/iss.m
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,21 @@
% r. To get the global coordinate of a point, add this to the local
% coordinate within the tile (counting from 1)
TileOrigin;

% TileInitialPosXY(t,:): coordinate of tile t in integers. This is
% the derived coordinates, before using the fact we know the answer
% to get TilePosYXC.
TileInitialPosYX;

% TilePosYX is the updated version of TileInitialPosYX, after being
% modified by the get_TilePos function.
TilePosYX;

% Temporary variables generated as a part of the get_TilePos
% function which are needed outside that function.
MaxX;
MaxY;

%RawLocalYXZ{t} stores the YXZ coordinates of spots found in the
%anchor round of tile t
RawLocalYXZ;
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ The README of the master branch gives instructions of how to run the pipeline an
* The figure number of ```o.plot``` is now 93454, so when calling ```iss_view_prob``` or ```iss_view_codes```, [the figure number will need to be changed to this](https://github.com/jduffield65/iss/blob/11c185d41534e46a4662a6089c50cb8fddb4b89f/bridge_process_template.m#L144-L145).
* The ```o.plot``` figure now has a scrollbar which allows you to see how the genes are distributed at each z coordinate. To concatenate genes from other planes onto a single plane, use [```o.PlotZThick```](https://github.com/jduffield65/iss/blob/11c185d41534e46a4662a6089c50cb8fddb4b89f/bridge_process_template.m#L134). This is defined such that all genes with z coordinate within ```+/-o.PlotZThick``` of the current z coordinate (chosen by the scrollbar) are shown. After changing this, ```iss_change_plot(o)``` needs to be run for it to take effect.
* Apart from these, there are of course many instances when 2D coordinates/shifts/transforms are converted into 3D.

# System requirements

- Matlab signal processing toolbox
- Matlab image processing toolbox
28 changes: 14 additions & 14 deletions bridge_process_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%CHECK BEFORE EACH RUN
o = iss;
o.ReferenceRound = 8; %Round that contains Dapi image (Starting from 1).
o.AnchorChannel = ; %Channel that has most spots in o.AnchorRound (Starting from 1).
o.AnchorChannel = 5 ; %Channel that has most spots in o.AnchorRound (Starting from 1).
o.DapiChannel = 1; %Channel in o.AnchorRound that contains Dapi images (Starting from 1).
o.InitialShiftChannel = o.AnchorChannel; %Channel to use to find initial shifts between rounds (Starting from 1).
o.ExtractScaleChannel = o.AnchorChannel; %Channel which is used to get scaling for imaging rounds (Starting from 1).
Expand All @@ -17,27 +17,27 @@

%% File Names
%CHECK BEFORE EACH RUN
o.InputDirectory = '...\Experiment1\raw_data'; %Folder path of raw data
o.InputDirectory = '\\128.40.224.65\Subjects\FR187\ISS\seq\FR178 b2a3 b2a5\B2A3\raw_data'; %Folder path of raw data

%FileBase{r} is the file name of the raw data of round r in o.InputDirectory
o.nBP = 7; %Number of Channels
o.nRounds = 7; %Number of Imaging Rounds
o.nExtraRounds = 1; %Treat Anchor channel as extra round
o.FileBase = cell(o.nRounds+o.nExtraRounds,1);
o.FileBase{1} = 'round0';
o.FileBase{2} = 'round1';
o.FileBase{3} = 'round2';
o.FileBase{4} = 'round3';
o.FileBase{5} = 'round4';
o.FileBase{6} = 'round5';
o.FileBase{7} = 'round6';
o.FileBase{8} = 'anchor'; %Make sure the last round is the anchor

o.TileDirectory = '...\Experiment1\tiles';
o.OutputDirectory = '...\Experiment1\output';
o.FileBase{1} = 'FR178_b2a3_R0';
o.FileBase{2} = 'FR178_b2a3_R1';
o.FileBase{3} = 'FR178_b2a3_R2';
o.FileBase{4} = 'FR178_b2a3_R3';
o.FileBase{5} = 'FR178_b2a3_R4';
o.FileBase{6} = 'FR178_b2a3_R5';
o.FileBase{7} = 'FR178_b2a3_R6';
o.FileBase{8} = 'FR178_b2a3_R7'; %Make sure the last round is the anchor

o.TileDirectory = '\\128.40.224.65\Subjects\FR187\ISS\seq\FR178 b2a3 b2a5\B2A3\tiles';
o.OutputDirectory = '\\128.40.224.65\Subjects\FR187\ISS\seq\FR178 b2a3 b2a5\B2A3\output';
%Codebook is a text file containing 2 columns - 1st is the gene name. 2nd is
%the code, length o.nRounds and containing numbers in the range from 0 to o.nBP-1.
o.CodeFile = '\\zserver\Data\ISS\codebook_73gene_6channels_2col.txt';
o.CodeFile = 'C:\Users\Experiment\Documents\GitHub\73g_codebook';

%% Logging
if o.LogToFile
Expand Down