Home > SuperSegger > frameLink > markDivisionEvent.m

markDivisionEvent

PURPOSE ^

markDivisionEvent : marks a division event from regR to sister 1 and 2.

SYNOPSIS ^

function [data_c, data_r, cell_count] = markDivisionEvent(data_c, sister1, data_r, regR, time, errorStat, sister2, cell_count)

DESCRIPTION ^

 markDivisionEvent : marks a division event from regR to sister 1 and 2.
 regR is the region in data_c (the mother) and sister 1 and sister 2
 are the two daughter cells in data_c. They will be given cell ids 
 cell count + 1 and cell_count + 2.

 INPUT :
       data_c : data file (err/seg file) in current frame
       sister1 : region number of first daughter in current frame
       sister2 : region number of second daughter in current frame
       data_r : data file (err/seg file) in reverse frame
       regR : region number of mother cell in reverse frame
       time : current time frame
       errorStat : error flag
       cell_count : last cell id used

 OUTPUT :
       data_c : updated data file (err/seg file
       data_r : updated data file (err/seg file


 Copyright (C) 2016 Wiggins Lab
 Written by Stella Stylianidou, Paul Wiggins.
 University of Washington, 2016
 This file is part of SuperSegger.

 SuperSegger is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 SuperSegger is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [data_c, data_r, cell_count] = markDivisionEvent( ...
0002     data_c, sister1, data_r, regR, time, errorStat, sister2, cell_count)
0003 % markDivisionEvent : marks a division event from regR to sister 1 and 2.
0004 % regR is the region in data_c (the mother) and sister 1 and sister 2
0005 % are the two daughter cells in data_c. They will be given cell ids
0006 % cell count + 1 and cell_count + 2.
0007 %
0008 % INPUT :
0009 %       data_c : data file (err/seg file) in current frame
0010 %       sister1 : region number of first daughter in current frame
0011 %       sister2 : region number of second daughter in current frame
0012 %       data_r : data file (err/seg file) in reverse frame
0013 %       regR : region number of mother cell in reverse frame
0014 %       time : current time frame
0015 %       errorStat : error flag
0016 %       cell_count : last cell id used
0017 %
0018 % OUTPUT :
0019 %       data_c : updated data file (err/seg file
0020 %       data_r : updated data file (err/seg file
0021 %
0022 %
0023 % Copyright (C) 2016 Wiggins Lab
0024 % Written by Stella Stylianidou, Paul Wiggins.
0025 % University of Washington, 2016
0026 % This file is part of SuperSegger.
0027 %
0028 % SuperSegger is free software: you can redistribute it and/or modify
0029 % it under the terms of the GNU General Public License as published by
0030 % the Free Software Foundation, either version 3 of the License, or
0031 % (at your option) any later version.
0032 %
0033 % SuperSegger is distributed in the hope that it will be useful,
0034 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0035 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0036 % GNU General Public License for more details.
0037 
0038 
0039 
0040 if ~data_c.regs.ID(sister1)
0041     cell_count = cell_count+1;
0042     
0043     % set sister 1 - regC
0044     data_c.regs.death(sister1) = time; % Death/divide time
0045     data_c.regs.deathF(sister1) = 1; % Divides in this frame
0046     data_c.regs.birth(sister1) = time; % Birth Time
0047     data_c.regs.birthF(sister1) = 1; % Division in this frame
0048     data_c.regs.age(sister1) = 1; % cell age. starts at 1.
0049     data_c.regs.divide(sister1) = 0; % succesful division in this frame
0050     data_c.regs.ehist(sister1) = errorStat; % 1 if cell has an unresolved error before this time.
0051     data_c.regs.stat0(sister1) = ~errorStat; % 1 for successful division.
0052     data_c.regs.sisterID(sister1) = cell_count+1;   % sister cell ID
0053     data_c.regs.motherID(sister1) = data_r.regs.ID(regR);   % mother cell ID
0054     data_c.regs.daughterID{sister1} = [];   % daughter cell ID
0055     data_c.regs.ID(sister1) = cell_count; % cell ID number
0056     data_c.regs.ID_{sister1} = cell_count; % cell ID number.
0057     
0058     % set the sister 2 : ii_sister
0059     cell_count = cell_count+1;
0060     data_c.regs.death(sister2) = time; % Death/division time
0061     data_c.regs.deathF(sister2) = 1; % Division in this frame
0062     data_c.regs.birth(sister2) = time; % Birth Time
0063     data_c.regs.birthF(sister2) = 1; % Division in this frame
0064     data_c.regs.age(sister2) = 1; % cell age. starts at 1
0065     data_c.regs.divide(sister2) = 0; % succesful division in this frame
0066     data_c.regs.ehist(sister2) = errorStat; % True if unresolved error before this time.
0067     data_c.regs.stat0(sister2) = ~errorStat;  % 1 if successful division
0068     data_c.regs.sisterID(sister2) = cell_count-1;   % sister cell ID
0069     data_c.regs.motherID(sister2) = data_r.regs.ID(regR);   % mother cell ID
0070     data_c.regs.daughterID{sister2} = [];   % daughter cell ID
0071     data_c.regs.ID(sister2) = cell_count; % cell ID number
0072     data_c.regs.ID_{sister2} = cell_count; % cell ID number.
0073 
0074     % put the daughters' ids at the mother
0075     data_r.regs.divide(regR)     = ~errorStat;    % succesful divide in this
0076     data_r.regs.daughterID{regR} = [cell_count-1,cell_count];   % daughter cell ID
0077     
0078     if isfield( data_c.regs, 'lyse' )
0079         data_c.regs.lyse.errorColor1Cum(sister2) = ...
0080             time*double(logical(data_c.regs.lyse.errorColor1(sister2)));
0081         data_c.regs.lyse.errorColor2Cum(sister2) = ...
0082             time*double(logical(data_c.regs.lyse.errorColor2(sister2)));
0083         data_c.regs.lyse.errorShapeCum(sister2)  = ...
0084             time*double(logical(data_c.regs.lyse.errorShape(sister2)));
0085         data_c.regs.lyse.errorColor1Cum(sister1) = ...
0086             time*double(logical(data_c.regs.lyse.errorColor1(sister1)));
0087         data_c.regs.lyse.errorColor2Cum(sister1) = ...
0088             time*double(logical(data_c.regs.lyse.errorColor2(sister1)));
0089         data_c.regs.lyse.errorShapeCum(sister1)  = ...
0090             time*double(logical(data_c.regs.lyse.errorShape(sister1)));
0091         data_c.regs.lyse.errorColor1bCum(sister2) = ...
0092             time*double(logical(data_c.regs.lyse.errorColor1b(sister2)));
0093         data_c.regs.lyse.errorColor2bCum(sister2) = ...
0094             time*double(logical(data_c.regs.lyse.errorColor2b(sister2)));
0095         data_c.regs.lyse.errorColor1bCum(sister1) = ...
0096             time*double(logical(data_c.regs.lyse.errorColor1b(sister1)));
0097         data_c.regs.lyse.errorColor2bCum(sister1) = ...
0098             time*double(logical(data_c.regs.lyse.errorColor2b(sister1)));
0099     end
0100 end
0101 end

Generated on Thu 19-Jan-2017 13:55:21 by m2html © 2005