-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsim_prot_from_gene.m
More file actions
40 lines (33 loc) · 1.12 KB
/
sim_prot_from_gene.m
File metadata and controls
40 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
syn_gene = table2array(genes_clearance);
syn_rate = normcdf(zscore(syn_gene));
sTerm = 1 ./ sconnLen .* dt; sTerm(isinf(sTerm)) = 0;
wTerm = weights .* dt;
for i = 1
alphaTerm = (syn_rate(:,i) .* ROIsize) .* dt;
iter_max = 10000;
Rnor = alphaTerm;
Rall = alphaTerm;
Pnor = zeros(N_regions);
for t = 1:iter_max
%%% moving process
% regions towards paths
movDrt = Rnor .* wTerm; % IMPLICIT EXPANSION
% paths towards regions
movOut = Pnor .* sTerm; % longer path & smaller v = lower probability of moving out of paths
Pnor = Pnor - movOut + movDrt;
Rtmp = Rnor;
Rnor = Rnor + sum(movOut, 1)' - sum(movDrt, 2);
%%% growth process
% select a random clearance gene
degr_gene = syn_gene(:, randi(size(syn_gene, 2)));
degr_rate = normcdf(zscore(degr_gene));
betaTerm = exp(-(0.7 .* degr_rate).*dt);
Rnor = Rnor .* betaTerm + alphaTerm;
if abs(Rnor - Rtmp) < (1e-7 * Rtmp); break; end
Rall = cat(2, Rall, Rnor);
end
figure;
plot(Rall')
figure;
scatter(Rnor, alphaTerm)
end