Commit cca3eecf authored by Antonio Politi's avatar Antonio Politi

Multiparameter live cell model

parent b97eff37
......@@ -83,6 +83,7 @@ classdef absPoreMaturation < handle
end
end
dist = [distNC distC];
%dist = [distNC;
end
%%
......@@ -99,8 +100,8 @@ classdef absPoreMaturation < handle
plot(MO.protF(i).time, MO.protF(i).noncore(:,1), 'bo');
plot(MO.protF(i).time, MO.protF(i).core(:,1), 'go');
plot(MO.protF(i).time(idxd(1):end), prot(i).NC(idxm(1):end), 'b--');
plot(MO.protF(i).time(idxd(2):end), prot(i).C(idxm(2):end), 'g--');
plot(MO.protF(i).time(idxd(1):end), prot(i).NC(idxm(1):end), 'c--');
plot(MO.protF(i).time(idxd(2):end), prot(i).C(idxm(2):end), 'r--');
ylabel('Relative fluorescence')
legend('Core data', 'Non-core data', 'Core model', 'Non-core model')
ylim([0 1.2])
......@@ -117,8 +118,8 @@ classdef absPoreMaturation < handle
subplot(3,1,3)
hold
plot(MO.protF(i).time, MO.protF(i).core(:,1), 'go');
plot(MO.protF(i).time(idxd(2):end), prot(i).C_pm(idxm(2):end)', 'g--');
plot(MO.protF(i).time(idxd(2):end), prot(i).C_ip(idxm(2):end)', 'g--', 'LineWidth', 2);
plot(MO.protF(i).time(idxd(2):end), prot(i).C_pm(idxm(2):end)', 'r--');
plot(MO.protF(i).time(idxd(2):end), prot(i).C_ip(idxm(2):end)', 'r--', 'LineWidth', 2);
legend('Core data', 'Core 1', 'Core 2')
ylabel('Relative fluorescence')
xlabel('Time (min)')
......@@ -126,7 +127,12 @@ classdef absPoreMaturation < handle
end
end
function [A, dAdt, kg] = getSurf(MO, time)
A = fnval(MO.protF(1).surfspl, time);
dAdt = fnval(MO.protF(1).dsurfspl, time);
kg = dAdt./A;
end
function y = solveModelN(MO, par, time, iprot)
y = ode45(@MO.model,time,[1;zeros(MO.N1+MO.N2,1)], odeset, par, iprot);
end
......
This diff is collapsed.
%% collections of function calls to run the fits and compute confidence intervals
% time begin interphase assembly for Non-core and core region
clear;
clear all;
fclose all
tip = [10 10];
tpm = [4 4];
nrfits = 10;
for N=3:10
for N1 = 2:N-1
MO = poreMaturationTotalProdDeg(N,N1, tpm, tip, 0, 0);
par = [1*ones(1,2*(N-1)) 0 0 0.92 0.5 1 1 1 1];
ifit = [1:2*(N-1) 2*N+1:2*N+6];
fname = ['poreMatuLiveMultiParFractionN_' num2str(N) 'N1_' num2str(N1) '.txt'];
MO.runFit(par, ifit, nrfits, 0.5, fname);
parf = MO.getBestfit(fullfile(MO.outdir, fname));
MO.showGraph(parf,[1 2], 1, fullfile(MO.outdir, fname) );
ifit = [1:2*(N-1) 2*N+3:2*N+6];
fname = ['poreMatuLiveMultiParFractionN_' num2str(N) 'N1_' num2str(N1) '.txt'];
MO.runFit(par, ifit, nrfits, 0.5, fname)
parf = MO.getBestfit(fullfile(MO.outdir, fname));
MO.showGraph(parf,[1 2], 1, fullfile(MO.outdir, fname) );
end
end
%%
clear;
clear all;
fclose all
tip = [10 10];
tpm = [4 4];
nrfits = 10;
for N=3:10
for N1 = 2:N-1
MO = poreMaturationTotalProdDeg(N,N1, tpm, tip, 0, 0);
par = [1*ones(1,2*(N-1)) 4.200e-04 4.2e-4 0.92 0.5 1 1 1 1];
ifit = [1:2*N 2*N+1:2*N+6];
MO.runFit(par, ifit, nrfits, 0.5, ['poreMatuLiveMultiParFractionProdDegN_' num2str(N) 'N1_' num2str(N1) '.txt'])
ifit = [1:2*N 2*N+3:2*N+6];
MO.runFit(par, ifit, nrfits, 0.5, ['poreMatuLiveMultiParProdDegN_' num2str(N) 'N1_' num2str(N1) '.txt'])
end
end
\ No newline at end of file
classdef poreMaturationReducedPara < absPoreMaturationMultiPar
%% Multi step maturation process N1 steps with rate equal k1 and N2 steps with rate equal k2
% Compute total number of pores so no need to use the surface area
% k1-kN-1 are the transition rates for postmitotic and interphase. The
% last transition is the accumulation of the 2nd protein (NUP358)
% N1 is the position where the first protein is present
% X_1 -k1> X_2 ... -k2> X_(N1+1) -k3> X_(N1+2) ... -kN-1> X_(N)
% sum X_(i=N1)_end: protein1
% X_(N): protein2
% paramters are
% k1, k2 (postmitotic); k1, k2 (interphase); kd; vproduction;
% fraction_maturePore_noncore; fraction_maturePore_core;
% scaling_factor_protein1_NC;scaling_factor_protein2_NC;scaling_factor_protein1_Core;
% scaling_factor_protein2_Core;
methods
function MO = poreMaturationReducedPara(N, N1, tpm, ti, force, showplot)
MO@absPoreMaturationMultiPar(N, N1, tpm, ti,force, showplot)
MO.protF = MO.protA;
for i=1:2
MO.protF(i).core = MO.protA(i).tot_core;
MO.protF(i).noncore = MO.protA(i).tot_noncore;
end
MO.parnames = '';
for i=1:2
MO.parnames = [MO.parnames 'kpm' num2str(i) ' '];
end
for i=1:2
MO.parnames = [MO.parnames 'kip' num2str(i) ' '];
end
MO.parnames = [MO.parnames 'kd v fMP_NC fMP_C scal_prot1_NC scal_prot2_NC scal_prot1_C scal_prot2_C'];
MO.LB = [0 0 0 0 0 0 0.9 0.385 0.8 0.8 0.8 0.8];
MO.HB = [10 10 10 10 0.1 0.1 0.94 0.617 1.2 1.2 1.2 1.2 ];
MO.name = mfilename('class');
end
function setTimeStart(MO, tpm, ti)
% set time of start of assembly of postmitotic and interphase
assert(length(tpm) > 1)
assert(length(ti) > 1)
MO.tpm = round(tpm);
MO.ti = round(ti);
end
function [prot] = computeProteins(MO, par, iprot)
%% compute distance model to data
% par: par(1) - k1 for postmitotic
% par(2) - k2 for postmitotic
% par(3) - k1 for interphase
% par(4) - k2 for interphase
% par(5) - fraction postmitotic in non-core region
% par(6) - fraction postmitotic in core region
% par(7) - coefficient scaling non-core protein 1
% par(8) - coefficient scaling non-core protein 2
% par(9) - coefficient scaling core protein 1
% par(10) - coefficient scaling core protein 2
% par(11) - v, production of intermediates
% par(12) - kd, degradation of mature pores
%experimental data has 1 min time resolution
smoothedArea = fnval(MO.protF(1).surfspl, MO.protF(1).time');
parloc = [par(1)*ones(1,MO.N1-1) par(2)*ones(1, MO.N-MO.N1)];
PM = MO.solveModelN([parloc par(5) par(6)], MO.timeI,1);
parlocIP = [par(3)*ones(1,MO.N1-1) par(4)*ones(1, MO.N-MO.N1)];
IP = MO.solveModelN([parlocIP par(5) par(6)], MO.timeI,1);
%compute solution for specific time
PM_t = deval(PM, MO.timeI);
IP_t = deval(IP, MO.timeI);
%% compute protein amounts in non-core and core regions
tend = MO.protF(1).time(end);
iend = MO.protF(1).time(end) + 1;
p1NC_pm = [zeros(1, MO.tpm(1)-4) sum(PM_t(MO.N1:end,1:iend-MO.tpm(1)))]*par(7)*par(9);
p1NC_ip = [zeros(1, MO.ti(1)-4) sum(IP_t(MO.N1:end,1:iend-MO.ti(1)))]*(1-par(7))*par(9);
p1NC = (p1NC_pm+p1NC_ip);
p1NC_den = p1NC./smoothedArea;
p2NC_pm = [zeros(1,MO.tpm(1)-4) PM_t(end,1:iend-MO.tpm(1))]*par(7)*par(10);
p2NC_ip = [zeros(1,MO.ti(1)-4) IP_t(end,1:iend-MO.ti(1))]*(1-par(7))*par(10);
p2NC = (p2NC_pm + p2NC_ip);
p2NC_den = p2NC./smoothedArea;
p1C_pm = [zeros(1,MO.tpm(2)-4) sum(PM_t(MO.N1:end,1:iend-MO.tpm(2)))]*par(8)*par(11);
p1C_ip = [zeros(1,MO.ti(2)-4) , sum(IP_t(MO.N1:end,1:iend-MO.ti(2)))]*(1-par(8))*par(11);
p1C_ip_den = p1C_ip/(1-par(8))/par(11)./smoothedArea*max(smoothedArea);
p1C = (p1C_pm + p1C_ip);
p1C_den = p1C./smoothedArea;
p2C_pm = [zeros(1,MO.tpm(2)-4) PM_t(end,1:iend-MO.tpm(2))]*par(8)*par(12);
p2C_ip = [zeros(1,MO.ti(2)-4) IP_t(end,1:iend-MO.ti(2))]*(1-par(8))*par(12);
p2C_ip_den = p2C_ip/(1-par(8))/par(12)./smoothedArea*max(smoothedArea);
p2C = (p2C_pm+ p2C_ip);
p2C_den = p2C./smoothedArea;
%densities
p1 = struct('time_NC', [4:tend],'time_C', [4:tend], 'NC', p1NC, 'NC_pm', p1NC_pm, 'NC_ip', p1NC_ip,...
'C', p1C, 'C_pm', p1C_pm, 'C_ip', p1C_ip, 'C_pm_pure', p1C_pm/par(6)/par(9), 'C_ip_pure', p1C_ip/(1-par(6))/par(9), 'C_ip_den', p1C_ip_den);
p2 = struct('time_NC',[4:tend],'time_C',[4:tend], 'NC', p2NC, 'NC_pm', p2NC_pm, 'NC_ip', p2NC_ip, ...
'C', p2C, 'C_pm', p2C_pm, 'C_ip', p2C_ip, 'C_pm_pure', p2C_pm/par(6)/par(10), 'C_ip_pure', p2C_ip/(1-par(6))/par(10), 'C_ip_den', p2C_ip_den);
prot = [p1;p2];
%%
end
function M = modelMatrix(MO, par)
%% Generate matrix for multi step maturation process N1 steps with rate equal k1 and N2 steps with rate equal k2
% k1 set the rate for formation of protein1 containing complex
% k2 set the rate of intermediate steps until protein2 is
% integrated
% X_1 -k1> X_2 ... -k1> X_(N1+1) -k2> X_(N1+2) ... -k2> X_(N1+N2+1)
M1 = diag(-1*ones(1,MO.N));
M2 = diag(ones(1,MO.N),-1);
M = M1*diag(par(1:end-1)) + M2(1:end-1, 1:end-1)*diag(par(1:end-1));
end
function dydt = model(MO, t, y, par, iprot)
%% model to integrate
Ar = fnval(MO.protF(1).surfspl, t);
M = MO.modelMatrix(par);
dydt = M*y;
if t > MO.ti(iprot)
dydt = dydt + Ar*par(end)*ones(MO.N,1);
end
end
end
end
classdef poreMaturationReducedPara2 < absPoreMaturationMultiPar
%% Multi step maturation process N1 steps with rate equal k1 and N2 steps with rate equal k2
% Compute total number of pores so no need to use the surface area
% k1-kN-1 are the transition rates for postmitotic and interphase. The
% last transition is the accumulation of the 2nd protein (NUP358)
% N1 is the position where the first protein is present
% X_1 -k1> X_2 ... -k2> X_(N1+1) -k3> X_(N1+2) ... -kN-1> X_(N)
% sum X_(i=N1)_end: protein1
% X_(N): protein2
% paramters are 2 steps for post mitotic and several steps for
% interphase
% k1, k2 (postmitotic); k1, kN-1 (interphase); kd; vproduction;
% fraction_maturePore_noncore; fraction_maturePore_core;
% scaling_factor_protein1_NC;scaling_factor_protein2_NC;scaling_factor_protein1_Core;
% scaling_factor_protein2_Core;
methods
function MO = poreMaturationReducedPara2(N, N1, tpm, ti, force, showplot)
MO@absPoreMaturationMultiPar(N, N1, tpm, ti,force, showplot)
MO.protF = MO.protA;
for i=1:2
MO.protF(i).core = MO.protA(i).tot_core;
MO.protF(i).noncore = MO.protA(i).tot_noncore;
end
MO.parnames = '';
for i=1:2
MO.parnames = [MO.parnames 'kpm' num2str(i) ' '];
end
for i=1:MO.N-1
MO.parnames = [MO.parnames 'kip' num2str(i) ' '];
end
MO.parnames = [MO.parnames 'kd v fMP_NC fMP_C scal_prot1_NC scal_prot2_NC scal_prot1_C scal_prot2_C'];
MO.LB = [zeros(1,MO.N+1) 0 0 0.9 0.385 0.8 0.8 0.8 0.8];
MO.HB = [10*ones(1,MO.N+1) 0.1 0.1 0.94 0.617 1.2 1.2 1.2 1.2 ];
MO.name = mfilename('class');
end
function setTimeStart(MO, tpm, ti)
% set time of start of assembly of postmitotic and interphase
assert(length(tpm) > 1)
assert(length(ti) > 1)
MO.tpm = round(tpm);
MO.ti = round(ti);
end
function [prot] = computeProteins(MO, par, iprot)
%% compute distance model to data
% par: par(1) - k1 for postmitotic
% par(2) - k2 for postmitotic
% par(3) - k1 for interphase
% par(4) - k2 for interphase
% par(5) - fraction postmitotic in non-core region
% par(6) - fraction postmitotic in core region
% par(7) - coefficient scaling non-core protein 1
% par(8) - coefficient scaling non-core protein 2
% par(9) - coefficient scaling core protein 1
% par(10) - coefficient scaling core protein 2
% par(11) - v, production of intermediates
% par(12) - kd, degradation of mature pores
%experimental data has 1 min time resolution
smoothedArea = fnval(MO.protF(1).surfspl, MO.protF(1).time');
Nloc = MO.N;
N1loc = MO.N1;
parloc = [par(1) par(2) par(MO.N+2) par(MO.N+3)];
MO.N = 3;
MO.N1 = 2;
PM = MO.solveModelN(parloc, MO.timeI,1);
MO.N = Nloc;
MO.N1 = N1loc;
IP = MO.solveModelN([par(3:MO.N+1) par(MO.N+2) par(MO.N+3)], MO.timeI,1);
%compute solution for specific time
PM_t = deval(PM, MO.timeI);
IP_t = deval(IP, MO.timeI);
%% compute protein amounts in non-core and core regions
baseN = MO.N+4;
tend = MO.protF(1).time(end);
iend = MO.protF(1).time(end) + 1;
p1NC_pm = [zeros(1, MO.tpm(1)-4) sum(PM_t(2:end,1:iend-MO.tpm(1)))]*par(baseN)*par(baseN+2);
p1NC_ip = [zeros(1, MO.ti(1)-4) sum(IP_t(MO.N1:end,1:iend-MO.ti(1)))]*(1-par(baseN))*par(baseN+2);
p1NC = (p1NC_pm+p1NC_ip);
p1NC_den = p1NC./smoothedArea;
p2NC_pm = [zeros(1,MO.tpm(1)-4) PM_t(end,1:iend-MO.tpm(1))]*par(baseN)*par(baseN+3);
p2NC_ip = [zeros(1,MO.ti(1)-4) IP_t(end,1:iend-MO.ti(1))]*(1-par(baseN))*par(baseN+3);
p2NC = (p2NC_pm + p2NC_ip);
p2NC_den = p2NC./smoothedArea;
p1C_pm = [zeros(1,MO.tpm(2)-4) sum(PM_t(2:end,1:iend-MO.tpm(2)))]*par(baseN+1)*par(baseN+4);
p1C_ip = [zeros(1,MO.ti(2)-4) , sum(IP_t(MO.N1:end,1:iend-MO.ti(2)))]*(1-par(baseN+1))*par(baseN+4);
p1C_ip_den = p1C_ip/(1-par(baseN+1))/par(baseN+4)./smoothedArea*max(smoothedArea);
p1C = (p1C_pm + p1C_ip);
p1C_den = p1C./smoothedArea;
p2C_pm = [zeros(1,MO.tpm(2)-4) PM_t(end,1:iend-MO.tpm(2))]*par(baseN+1)*par(baseN+5);
p2C_ip = [zeros(1,MO.ti(2)-4) IP_t(end,1:iend-MO.ti(2))]*(1-par(baseN+1))*par(baseN+5);
p2C_ip_den = p2C_ip/(1-par(baseN+1))/par(baseN+5)./smoothedArea*max(smoothedArea);
p2C = (p2C_pm+ p2C_ip);
p2C_den = p2C./smoothedArea;
%densities
p1 = struct('time_NC', [4:tend],'time_C', [4:tend], 'NC', p1NC, 'NC_pm', p1NC_pm, 'NC_ip', p1NC_ip,...
'C', p1C, 'C_pm', p1C_pm, 'C_ip', p1C_ip, 'C_pm_pure', p1C_pm/par(6)/par(9), 'C_ip_pure', p1C_ip/(1-par(6))/par(9), 'C_ip_den', p1C_ip_den);
p2 = struct('time_NC',[4:tend],'time_C',[4:tend], 'NC', p2NC, 'NC_pm', p2NC_pm, 'NC_ip', p2NC_ip, ...
'C', p2C, 'C_pm', p2C_pm, 'C_ip', p2C_ip, 'C_pm_pure', p2C_pm/par(6)/par(10), 'C_ip_pure', p2C_ip/(1-par(6))/par(10), 'C_ip_den', p2C_ip_den);
prot = [p1;p2];
%%
end
function M = modelMatrix(MO, par)
%% Generate matrix for multi step maturation process N1 steps with rate equal k1 and N2 steps with rate equal k2
% k1 set the rate for formation of protein1 containing complex
% k2 set the rate of intermediate steps until protein2 is
% integrated
% X_1 -k1> X_2 ... -k1> X_(N1+1) -k2> X_(N1+2) ... -k2> X_(N1+N2+1)
M1 = diag(-1*ones(1,MO.N));
M2 = diag(ones(1,MO.N),-1);
M = M1*diag(par(1:end-1)) + M2(1:end-1, 1:end-1)*diag(par(1:end-1));
end
function dydt = model(MO, t, y, par, iprot)
%% model to integrate
Ar = fnval(MO.protF(1).surfspl, t);
M = MO.modelMatrix(par);
dydt = M*y;
if t > MO.ti(iprot)
dydt = dydt + Ar*par(end)*ones(MO.N,1);
end
end
end
end
......@@ -11,9 +11,15 @@ classdef poreMaturationTotal < absPoreMaturation
function MO = poreMaturationTotal(N1, N2, tpm, ti, force, showplot)
MO@absPoreMaturation(N1, N2, tpm, ti,force, showplot)
MO.protF = MO.protA;
for i=1:2
MO.protF(3-i).core = MO.protA(i).tot_core;
MO.protF(3-i).noncore = MO.protA(i).tot_noncore;
% %invert order
% for i=1:2
% MO.protF(3-i).core = MO.protA(i).tot_core;
% MO.protF(3-i).noncore = MO.protA(i).tot_noncore;
% end
for i=1:2
MO.protF(i).core = MO.protA(i).tot_core;
MO.protF(i).noncore = MO.protA(i).tot_noncore;
end
end
......@@ -49,29 +55,30 @@ classdef poreMaturationTotal < absPoreMaturation
IP_t = deval(IP, MO.timeI);
%% compute protein amounts in non-core and core regions
baseN = 5;
tend = MO.protF(1).time(end);
iend = MO.protF(1).time(end) + 1;
p1NC_pm = [zeros(1,MO.tpm(1)-4) sum(PM_t(MO.N1+1:end,1:iend-MO.tpm(1)))]*par(5)*par(7);
p1NC_ip = [zeros(1,MO.ti(1)-4) sum(IP_t(MO.N1+1:end,1:iend-MO.ti(1)))]*(1-par(5))*par(7);
p1NC_pm = [zeros(1,MO.tpm(1)-4) sum(PM_t(MO.N1+1:end,1:iend-MO.tpm(1)))]*par(baseN)*par(baseN+2);
p1NC_ip = [zeros(1,MO.ti(1)-4) sum(IP_t(MO.N1+1:end,1:iend-MO.ti(1)))]*(1-par(baseN))*par(baseN+2);
p1NC = (p1NC_pm+p1NC_ip);
p1NC = p1NC./smoothedArea;
p1NC_den = p1NC./smoothedArea;
p2NC_pm = [zeros(1,MO.tpm(1)-4) PM_t(end,1:iend-MO.tpm(1))]*par(5)*par(8);
p2NC_ip = [zeros(1,MO.ti(1)-4) IP_t(end,1:iend-MO.ti(1))]*(1-par(5))*par(8);
p2NC_pm = [zeros(1,MO.tpm(1)-4) PM_t(end,1:iend-MO.tpm(1))]*par(baseN)*par(baseN+3);
p2NC_ip = [zeros(1,MO.ti(1)-4) IP_t(end,1:iend-MO.ti(1))]*(1-par(baseN))*par(baseN+3);
p2NC = (p2NC_pm + p2NC_ip);
p2NC_den = p2NC./smoothedArea;
p1C_pm = [zeros(1,MO.tpm(2)-4) sum(PM_t(MO.N1+1:end,1:iend-MO.tpm(2)))]*par(6)*par(9);
p1C_ip = [zeros(1,MO.ti(2)-4) , sum(IP_t(MO.N1+1:end,1:iend-MO.ti(2)))]*(1-par(6))*par(9);
p1C_ip_den = p1C_ip/(1-par(6))/par(9)./smoothedArea*max(smoothedArea);
p1C_pm = [zeros(1,MO.tpm(2)-4) sum(PM_t(MO.N1+1:end,1:iend-MO.tpm(2)))]*par(baseN+1)*par(baseN+4);
p1C_ip = [zeros(1,MO.ti(2)-4) , sum(IP_t(MO.N1+1:end,1:iend-MO.ti(2)))]*(1-par(baseN+1))*par(baseN+4);
p1C_ip_den = p1C_ip/(1-par(baseN+1))/par(baseN+4)./smoothedArea*max(smoothedArea);
p1C = (p1C_pm + p1C_ip);
p1C_den = p1C./smoothedArea;
p2C_pm = [zeros(1,MO.tpm(2)-4) PM_t(end,1:iend-MO.tpm(2))]*par(6)*par(10);
p2C_ip = [zeros(1,MO.ti(2)-4) IP_t(end,1:iend-MO.ti(2))]*(1-par(6))*par(10);
p2C_ip_den = p2C_ip/(1-par(6))/par(10)./smoothedArea*max(smoothedArea);
p2C_pm = [zeros(1,MO.tpm(2)-4) PM_t(end,1:iend-MO.tpm(2))]*par(baseN+1)*par(baseN+5);
p2C_ip = [zeros(1,MO.ti(2)-4) IP_t(end,1:iend-MO.ti(2))]*(1-par(baseN+1))*par(baseN+5);
p2C_ip_den = p2C_ip/(1-par(baseN+1))/par(baseN+5)./smoothedArea*max(smoothedArea);
p2C = (p2C_pm+ p2C_ip);
p2C_den = p2C./smoothedArea;
......@@ -80,9 +87,9 @@ classdef poreMaturationTotal < absPoreMaturation
p1 = struct('time_NC', [4:tend],'time_C', [4:tend], 'NC', p1NC, 'NC_pm', p1NC_pm, 'NC_ip', p1NC_ip,...
'C', p1C, 'C_pm', p1C_pm, 'C_ip', p1C_ip, 'C_pm_pure', p1C_pm/par(6)/par(9), 'C_ip_pure', p1C_ip/(1-par(6))/par(9), 'C_ip_den', p1C_ip_den);
'C', p1C, 'C_pm', p1C_pm, 'C_ip', p1C_ip, 'C_pm_pure', p1C_pm/par(baseN+1)/par(baseN+4), 'C_ip_pure', p1C_ip/(1-par(baseN+1))/par(baseN+4), 'C_ip_den', p1C_ip_den);
p2 = struct('time_NC',[4:tend],'time_C',[4:tend], 'NC', p2NC, 'NC_pm', p2NC_pm, 'NC_ip', p2NC_ip, ...
'C', p2C, 'C_pm', p2C_pm, 'C_ip', p2C_ip, 'C_pm_pure', p2C_pm/par(6)/par(10), 'C_ip_pure', p2C_ip/(1-par(6))/par(10), 'C_ip_den', p2C_ip_den);
'C', p2C, 'C_pm', p2C_pm, 'C_ip', p2C_ip, 'C_pm_pure', p2C_pm/par(baseN+1)/par(baseN+5), 'C_ip_pure', p2C_ip/(1-par(baseN+1))/par(baseN+5), 'C_ip_den', p2C_ip_den);
prot = [p1;p2];
end
......
classdef poreMaturationTotalProdDeg < absPoreMaturationMultiPar
%% Multi step maturation process N1 steps with rate equal k1 and N2 steps with rate equal k2
% Compute total number of pores so no need to use the surface area
% k1-kN-1 are the transition rates for postmitotic and interphase. The
% last transition is the accumulation of the 2nd protein (NUP358)
% N1 is the position where the first protein is present
% X_1 -k1> X_2 ... -k2> X_(N1+1) -k3> X_(N1+2) ... -kN-1> X_(N)
% sum X_(i=N1)_end: protein1
% X_(N): protein2
% paramters are
% k1-kN-1 (postmitotic); k1-kN-1 (interphase); kd; vproduction;
% fraction_maturePore_noncore; fraction_maturePore_core;
% scaling_factor_protein1_NC;scaling_factor_protein2_NC;scaling_factor_protein1_Core;
% scaling_factor_protein2_Core;
methods
function MO = poreMaturationTotalProdDeg(N, N1, tpm, ti, force, showplot)
MO@absPoreMaturationMultiPar(N, N1, tpm, ti,force, showplot)
MO.protF = MO.protA;
for i=1:2
MO.protF(i).core = MO.protA(i).tot_core;
MO.protF(i).noncore = MO.protA(i).tot_noncore;
end
MO.parnames = '';
for i=1:MO.N-1
MO.parnames = [MO.parnames 'kpm' num2str(i) ' '];
end
for i=1:MO.N-1
MO.parnames = [MO.parnames 'kip' num2str(i) ' '];
end
MO.parnames = [MO.parnames 'kd v fMP_NC fMP_C scal_prot1_NC scal_prot2_NC scal_prot1_C scal_prot2_C'];
MO.LB = [zeros(1,2*MO.N) 0.9 0.385 0.8 0.8 0.8 0.8];
MO.HB = [10*ones(1,2*(MO.N-1)) 0.1 0.1 0.94 0.617 1.2 1.2 1.2 1.2 ];
MO.name = mfilename('class');
end
function setTimeStart(MO, tpm, ti)
% set time of start of assembly of postmitotic and interphase
assert(length(tpm) > 1)
assert(length(ti) > 1)
MO.tpm = round(tpm);
MO.ti = round(ti);
end
function [prot] = computeProteins(MO, par, iprot)
%% compute distance model to data
% par: par(1) - k1 for postmitotic
% par(2) - k2 for postmitotic
% par(3) - k1 for interphase
% par(4) - k2 for interphase
% par(5) - fraction postmitotic in non-core region
% par(6) - fraction postmitotic in core region
% par(7) - coefficient scaling non-core protein 1
% par(8) - coefficient scaling non-core protein 2
% par(9) - coefficient scaling core protein 1
% par(10) - coefficient scaling core protein 2
% par(11) - v, production of intermediates
% par(12) - kd, degradation of mature pores
%experimental data has 1 min time resolution
smoothedArea = fnval(MO.protF(1).surfspl, MO.protF(1).time');
PM = MO.solveModelN([par(1:MO.N-1) par(2*MO.N-1) par(2*MO.N)], MO.timeI,1);
IP = MO.solveModelN([par(MO.N:2*(MO.N-1)) par(2*MO.N-1) par(2*MO.N)], MO.timeI,1);
%compute solution for specific time
PM_t = deval(PM, MO.timeI);
IP_t = deval(IP, MO.timeI);
%% compute protein amounts in non-core and core regions
tend = MO.protF(1).time(end);
iend = MO.protF(1).time(end) + 1;
baseN = 2*MO.N+1;
% total amount post-mitotic non-core region
p1NC_pm = [zeros(1, MO.tpm(1)-4) sum(PM_t(MO.N1:end,1:iend-MO.tpm(1)))]*par(baseN)*par(baseN+2);
% total amount interphase non-core region
p1NC_ip = [zeros(1, MO.ti(1)-4) sum(IP_t(MO.N1:end,1:iend-MO.ti(1)))]*(1-par(baseN))*par(baseN+2);
p1NC = (p1NC_pm+p1NC_ip);
p1NC_den = p1NC./smoothedArea*max(smoothedArea)/par(baseN+2);
p2NC_pm = [zeros(1,MO.tpm(1)-4) PM_t(end,1:iend-MO.tpm(1))]*par(baseN)*par(baseN+3);
p2NC_ip = [zeros(1,MO.ti(1)-4) IP_t(end,1:iend-MO.ti(1))]*(1-par(baseN))*par(baseN+3);
p2NC = (p2NC_pm + p2NC_ip);
p2NC_den = p2NC./smoothedArea*max(smoothedArea)/par(baseN+3);
p1C_pm = [zeros(1,MO.tpm(2)-4) sum(PM_t(MO.N1:end,1:iend-MO.tpm(2)))]*par(baseN+1)*par(baseN+4);
p1C_ip = [zeros(1,MO.ti(2)-4) , sum(IP_t(MO.N1:end,1:iend-MO.ti(2)))]*(1-par(baseN+1))*par(baseN+4);
p1C_ip_den = p1C_ip/(1-par(baseN+1))/par(baseN+4)./smoothedArea*max(smoothedArea);
pC_nop1p2 = [zeros(1,MO.tpm(2)-4) sum(PM_t(1:MO.N1-1,1:iend-MO.tpm(2)),1)]*par(baseN+1)+ ...
[zeros(1,MO.ti(2)-4) , sum(IP_t(1:MO.N1-1,1:iend-MO.ti(2)),1)]*(1-par(baseN+1));
pC_nop1p2_den = pC_nop1p2./smoothedArea*max(smoothedArea);
pC_ip_nop1p2_den = [zeros(1,MO.ti(2)-4) , sum(IP_t(1:MO.N1-1,1:iend-MO.ti(2)),1)]*(1-par(baseN+1))./smoothedArea*max(smoothedArea);
p1C_nop2 = [zeros(1,MO.tpm(2)-4) sum(PM_t(MO.N1:end-1,1:iend-MO.tpm(2)),1)]*par(baseN+1)+ ...
[zeros(1,MO.ti(2)-4) , sum(IP_t(MO.N1:end-1,1:iend-MO.ti(2)),1)]*(1-par(baseN+1));
p1C_ip_nop2 = [zeros(1,MO.ti(2)-4) , sum(IP_t(MO.N1:end-1,1:iend-MO.ti(2)),1)]*(1-par(baseN+1));
p1C_nop2_den = p1C_nop2./smoothedArea*max(smoothedArea);
p1C_ip_nop2_den = p1C_ip_nop2./smoothedArea*max(smoothedArea);
p1C = (p1C_pm + p1C_ip);
p1C_den = p1C./smoothedArea*max(smoothedArea)/par(baseN+4);
p2C_pm = [zeros(1,MO.tpm(2)-4) PM_t(end,1:iend-MO.tpm(2))]*par(baseN+1)*par(baseN+5);
p2C_ip = [zeros(1,MO.ti(2)-4) IP_t(end,1:iend-MO.ti(2))]*(1-par(baseN+1))*par(baseN+5);
p2C_ip_den = p2C_ip/(1-par(baseN+1))/par(baseN+5