-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwaveguide_data_storage_with_oligomers_info.m
More file actions
154 lines (115 loc) · 4.84 KB
/
Copy pathwaveguide_data_storage_with_oligomers_info.m
File metadata and controls
154 lines (115 loc) · 4.84 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
f_latA_50 = {...
'C:\Users\Rafael\Documents\ITQB estágio\code\zmw1_1uMactin_LatA_nobump_thr150_Salapaka50',...
'C:\Users\Rafael\Documents\ITQB estágio\code\zmw5_1uM_LatA_cut_thr150_Salapaka50'};
f_actin_50 = {...
'C:\Users\Rafael\Documents\ITQB estágio\code\zmw1_1uMactin_nobump_thr300_Salapaka50',...
'C:\Users\Rafael\Documents\ITQB estágio\code\zmw2_BSA_nobump_thr300_Salapaka50'};
latA_NumSteps = {};
N6_NumSteps = {};
N4_NumSteps = {};
%%
oligomers_info = [];
files = f_latA_50;
for file = 1:length(files)
n_latA = 0;
load(files{file});
sz = size(Step);
latA_NumSteps{file} = zeros(sz(1),sz(2));
for i = 1:sz(1)
num_step = getNumSteps2(Step(i,:),50);
if num_step(1) == 0
if max(abs(diff(num_step))) >= 2
% add {jump_up,jump_down,elapsed_time}
d = diff(num_step);
mn = find(d==min(d));
mx = find(d==max(d));
for f = mx
for l = mn
% only count maximum after minimum
if l - f < 0
continue;
end
% only count if the sum of the jumps is larger than
% the time gap
if l - f > d(f) - d(l)
break;
else
% add info
oligomers_info = [oligomers_info;[d(f),d(f),d(l),d(f)+d(l),l-f+1,file,i]];
end
end
end
else
n_latA = n_latA + 1;
latA_NumSteps{file}(n_latA,:) = num_step;
end
end
end
latA_NumSteps{file} = latA_NumSteps{file}(1:n_latA,:);
oligomers_info = flipud(sortrows(oligomers_info));
oligomer_info_table = array2table(oligomers_info,'VariableNames',{'Oligomer_size','Up_jump','Down_jump','Level_change','Time_gap_in_frames','File','Trace'});
end
%%
oligomers_info = [];
files = f_actin_50;
for file = 1:length(files)
n_6 = 0;
n_4 = 0;
load(files{file});
sz = size(Step);
N6_NumSteps{file} = zeros(sz(1),sz(2));
N4_NumSteps{file} = zeros(sz(1),sz(2));
for i = 1:sz(1)
num_step = getNumSteps4(Step(i,:),50);
if num_step(1) == 0
if max(abs(diff(num_step))) >= 2
% add {jump_up,jump_down,elapsed_time}
d = diff(num_step);
mn = find(d==min(d));
mx = find(d==max(d));
for f = mx
for l = mn
% only count maximum after minimum
if l - f < 0
continue;
end
% only count if the sum of the jumps is larger than
% the time gap
if l - f > d(f) - d(l)
break;
else
% add info
oligomers_info = [oligomers_info;[d(f),d(f),d(l),d(f)+d(l),l-f+1,file,i,l-f-d(f)-d(l)]];
end
end
end
else
if num_step(end)>6
n_6 = n_6 + 1;
N6_NumSteps{file}(n_6,:) = num_step;
elseif num_step(end)<4
n_4 = n_4 + 1;
N4_NumSteps{file}(n_4,:) = num_step;
end
end
end
end
N6_NumSteps{file} = N6_NumSteps{file}(1:n_6,:);
N4_NumSteps{file} = N4_NumSteps{file}(1:n_4,:);
oligomers_info = flipud(sortrows(oligomers_info));
oligomer_info_table = array2table(oligomers_info,'VariableNames',{'Oligomer_size','Up_jump','Down_jump','Level_change','Time_gap_in_frames','File','Trace','ok'});
end
%%
for i = 1:100
plot(N6_NumSteps{i});
pause(1);
end
%%
dlmwrite('latA TRACE zmw1_1uMactin_nobump_thr300_Salapaka50.txt',latA_NumSteps{1},'delimiter','\t');
dlmwrite('latA TRACE zmw2_BSA_nobump_thr300_Salapaka50.txt',latA_NumSteps{2},'delimiter','\t');
dlmwrite('N6 TRACE zmw1_1uMactin_nobump_thr300_Salapaka50.txt',N6_NumSteps{1},'delimiter','\t');
dlmwrite('N6 TRACE zmw2_BSA_nobump_thr300_Salapaka50.txt',[N6_NumSteps{2}],'delimiter','\t');
dlmwrite('N3 TRACE zmw1_1uMactin_nobump_thr300_Salapaka50.txt',[N4_NumSteps{1}],'delimiter','\t');
dlmwrite('N3 TRACE zmw2_BSA_nobump_thr300_Salapaka50.txt',[N4_NumSteps{2}],'delimiter','\t');
%%
d = max(abs(diff(latA_NumSteps{1}')));