Default MTtbox interaction function

From BanghamLab
Jump to navigation Jump to search

Return to MTtbox details

(Comments are in green - this web version of the matlab file is created using webify_interaction_function('MT_Tues_20120501.m')).



function data = MT_Tues_20120501( data, before )
    if nargin < 1, return; end
% 
%
% extract factors from structure
    for i=1:size( data.factorprops.Concentration,2)
        factname=lower(data.factorprops.Index2Name{i});
        eval([[factname,'_p'],'=reshape(','data.factorprops.Concentration(:,i),[ data.cellprops.cellsize]);']);
        eval([[factname,'_i'],'=','data.factorprops.Name2Index.(factname);']);
    end
% insert model in here
%    data=setupDiffusion(data,'Factorname','s_micplm','DiffK',[0.2,0.2],...
%        'RegionLists',{{'cytoplasm','vacuole','cell_wall'},{'plasma_membrane','microtubules'}});
%    data=setupDiffusion(data,'Factorname','id_micplm','DiffK',[0,0],...
%        'RegionLists',{{'cytoplasm','vacuole','cell_wall'},{'plasma_membrane','microtubules'}});
%    data.factorprops.DiffusionConst(:,1)=0.1; % This should be superceed by the above
%    data.factorprops.DiffusionConst(:,2)=0.05;% This should be superceed by the above
    if data.iterations<0
        % insert initialisation code here - use Initialise button to jump to here
        % modify default cell specifications, etc. to modify how the cell volume is partitioned, e.g.
        % data.organelleprops.plasma_membrane.size=0.95; % fraction of longest dimension
        % data.organelleprops.cytoplasm.size=0.80;
        % data.organelleprops.vacuole.size=0.4;
        % data.organelleprops.microtubules.nuclspont=0.0012; % observed nucleations per square (cubic) micron per sec
    elseif data.iterations==0
        % insert startup code here - use Restart button to jump to here
        %% setup MT size
        %if data.cellprops.cellsize(1)>25
        %    data=mtSETprops(data,'microtubules','size',0.01,'microtubules','growthrate',0.025);
        %    data=mtSETprops(data,'microtubules','shrinkrate',0.005);
        %end
    else
        %id_micplm_p(:)=0; % clear
        %id_micplm_p(data.cellprops.Vol==data.organelleprops.cytoplasm.Label)=0.8; % set cytoplasm region to 1
        %id_micplm_p(round(data.cellprops.cellsize(1)/3):end,:,:)=0; % then set right hand end back to zero
        %s_micplm_p(id_micplm_p>0.1)=0.1;
        %%       limit spontaneous nucleation to a region specified by id_micplm_p
        %        data.organelleprops.microtubules.nuclspont=id_micplm_p;
        %data.cellprops.colourType=0; % set to 1 if colour is to be specified by individual MT property

        %Work through all the microtubules updating properties depending on flags
        %Average number of MT's present is observed to be about 80 i.e. 80/300 square microns (say 1 micron thick
        %so ~0.25 per square (cubic) micron
        for i_MT=1:length(data.working.dyn.microtubules.Org)
            MT=data.working.dyn.microtubules.Org(i_MT);
            % MTtbox monitors ...
            % MT.Age
            % MT.PauseDuration
            % MT.TimeNucleated
            % MT.Alive=true;
            % MT.Growing=true;
            % MT.Shrinking=true;
            % MT.Catastrophe=false;
            % MT.BoundPLM=false;
            % MT.PLMBindVertNums=[];
            % MT.BoundMic=false;
            % MT.MTBindVertNums=[];
            % MT.BoundVac=false;
            % MT.VacBindVertNums=[];     
            % MT.Hit=struct('Type',,'ID',[]);   
            % MT.HitMe=struct('Type',,'ID',[]); 
            % MT.Props.growthrate
            % MT.Props.shrinkrate
            % MT.Props.maxbend
            % MT.Props.maxAge
            % MT.Props.nuclspont
            % MT.Props.nuclonMT
            % Make changes here, i.e.
            % diffs=diff(MT.Verts).^2; % calculate length of MT
            % MTlength=sum(sqrt(sum(diffs')'))*data.cellprops.micronsPerVoxelEdge; % microns
            % if MTlength>0.5
            %    MT.Props.nuclonMT=min(1,0.4*MTlength); % observed approx. 0.007 per micron per sec
            % else
            %    MT.Props.nuclonMT=0;
            % end
            %ageMT=data.working.CellAge;% seconds
            %maxAgeColour=20;
            %MT.Props.FaceColor=[max(0,min(1,1-ageMT/maxAgeColour)), 0.5, max(0,min(1,ageMT/maxAgeColour))];
            %if  MT.BoundPLM && MT.Growing  % hit plasma_membrane and aligned
            %elseif MT.BoundPLM && ~MT.Growing  % hit plasma_membrane and NOT aligned
            %end
            %if  MT.BoundMic && MT.Growing  % hit another microtubule and aligned
            %elseif MT.BoundMic && ~MT.Growing  % hit another microtubule and NOT aligned
            %end
            %if  MT.BoundVac && MT.Growing  % hit vacuole membrane and aligned
            %elseif MT.BoundVac && ~MT.Growing  % hit vacuole membrane and NOT aligned
            %end
            % Keep the following
            % Clear flags from collision detector
            MT.BoundPLM=false;
            MT.BoundMic=false;
            MT.BoundVac=false;
            data.working.dyn.microtubules.Org(i_MT)=MT;
        end
    end

% put factors back into structure
    for i=1:size( data.factorprops.Concentration,2)
        factname=lower(data.factorprops.Index2Name{i});
        eval(['data.factorprops.Concentration(:,i)=',[factname,'_p(:);']]);
    end    

end

% This space intentionally left blank.
% Default factor parameters
% Default organelle parameters

%      cell_wall.size          =0.000000
%      cell_wall.offset        =0.500000
%      cell_wall.micronthick   =0.100000
%      cell_wall.minvox        =1.000000
%      cell_wall.FaceColor     =[1.000000,0.000000,1.000000,]
%      cell_wall.FaceAlpha     =0.010000
%      cell_wall.Label         =-5.000000
%      cell_wall.isLayer       =1.000000
%      cell_wall.Static        =1.000000
%      cell_wall.InUse         =1.000000

%plasma_membrane.size          =0.000000
%plasma_membrane.offset        =0.500000
%plasma_membrane.micronthick   =0.010000
%plasma_membrane.minvox        =3.000000
%plasma_membrane.FaceColor     =[1.000000,1.000000,0.000000,]
%plasma_membrane.FaceAlpha     =0.020000
%plasma_membrane.Label         =-4.000000
%plasma_membrane.isLayer       =1.000000
%plasma_membrane.Static        =1.000000
%plasma_membrane.InUse         =1.000000

%      cytoplasm.size          =0.000000
%      cytoplasm.offset        =0.500000
%      cytoplasm.micronthick   =1.000000
%      cytoplasm.minvox        =5.000000
%      cytoplasm.FaceColor     =[0.000000,1.000000,0.000000,]
%      cytoplasm.FaceAlpha     =0.020000
%      cytoplasm.Label         =0.000000
%      cytoplasm.isLayer       =1.000000
%      cytoplasm.Static        =1.000000
%      cytoplasm.InUse         =1.000000

%   microtubules.size          =0.025000
%   microtubules.minvoxel      =3.000000
%   microtubules.growthrate    =0.100000
%   microtubules.shrinkrate    =0.010000
%   microtubules.maxbend       =40.000000
%   microtubules.MaxAngle      =20.000000
%   microtubules.maxAge        =0.000000
%   microtubules.nuclspont     =0.050000
%   microtubules.nuclonMT      =0.090000
%   microtubules.probCatastrophe=0.300000
%   microtubules.FaceColor     =[0.000000,0.000000,1.000000,]
%   microtubules.FaceAlpha     =0.400000
%   microtubules.Label         =-6.000000
%   microtubules.isLayer       =0.000000
%   microtubules.Static        =0.000000
%   microtubules.InUse         =1.000000

%        vacuole.size          =0.200000
%        vacuole.offset        =0.500000
%        vacuole.micronthick   =1.000000
%        vacuole.minvox        =0.000000
%        vacuole.FaceColor     =[1.000000,1.000000,0.000000,]
%        vacuole.FaceAlpha     =0.300000
%        vacuole.Label         =-3.000000
%        vacuole.isLayer       =0.000000
%        vacuole.Static        =1.000000
%        vacuole.InUse         =1.000000
% Default cell parameters
% cellprops.shape          ='Rect:1:1:1'
% cellprops.sheetmodel     =0
% cellprops.maxLengthMicrons=10
% cellprops.secondsPerStep =1
% cellprops.micronsPerVoxelEdge=0.400000
% cellprops.cubicMicronsPerVoxel=0.064000
% cellprops.cellsize       =[25,25,25,]
% cellprops.colourType     =1
% cellprops.Vol            =[-1,-1,-1,-1, ... ]
% cellprops.Smooth         ='None'
% cellprops.dynamic        ='microtubules'
% cellprops.bound_distance =5
% cellprops.collide_distance=10
% cellprops.% vacuole.Vol=struct
% vacuole.EdgeVol=struct
% cellprops.% cell_wall.Vol=struct
% cell_wall.EdgeVol=struct
% cellprops.% plasma_membrane.Vol=struct
% plasma_membrane.EdgeVol=struct
% cellprops.% cytoplasm.Vol=struct
% cytoplasm.EdgeVol=struct
% cytoplasm.Indexes=struct
% cellprops.% Diameter.microtubules=struct
% cellprops.% microtubules.Vol=struct
% microtubules.Offsets=struct