-
Notifications
You must be signed in to change notification settings - Fork 0
/
F5_get_orindices.m
196 lines (181 loc) · 5.23 KB
/
F5_get_orindices.m
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
function F5_get_orindices(file1,file2,file3,file4,fileout)
% Extract info and getting original indices
load(file1)
% bad samples
for j=1:numel(boxlist)
if isempty(badsamples{1,j})==0
ofr_S1{1,j}=badsamples{1,j}.outsal;
ofr_T1{1,j}=badsamples{1,j}.outtemp;
inc_samples1{1,j}=badsamples{1,j}.incomplete;
else
ofr_S1{1,j}=[];
ofr_T1{1,j}=[];
inc_samples1{1,j}=[];
end
end
% bad profiles
for j=1:numel(boxlist)
N=output{1}(j,1);
if isfinite(N)
ind=1:N;
ind0{1,j}=ind;
excl=EXCL_all{1,j};
if isempty(excl)
ind1{1,j}=ind;
excl1{1,j}=[];
outofbox1{1,j}=[];
shallow1{1,j}=[];
nonmonotpres1{1,j}=[];
extraprof1{1,j}=[];
else
tmp=ind;tmp(excl)=[];
ind1{1,j}=tmp;
excl1{1,j}=excl;
outofbox1{1,j}=EXCL{1,j}{1};
shallow1{1,j}=EXCL{1,j}{2};
nonmonotpres1{1,j}=EXCL{1,j}{3};
extraprof1{1,j}=EXCL{1,j}{4};
end
else
ind1{1,j}=[];
excl1{1,j}=[];
outofbox1{1,j}=[];
shallow1{1,j}=[];
nonmonotpres1{1,j}=[];
extraprof1{1,j}=[];
end
end
clear bad* excl EXCL* i ind j N output output_label tmp boxlist
% FILE2
load(file2)
for j=1:numel(boxlist)
indpairs=IND{1,j};
ind=ind1{1,j};
if isempty(indpairs)==0
% get the original index for the pairs
pairs2{1,j}=ind(indpairs);
excl=ind(EXCL{1,j});
if isempty(excl)
ind2{1,j}=ind;
excl2{1,j}=[];
else
tmp=ind;tmp(EXCL{1,j})=[];
ind2{1,j}=tmp;
excl2{1,j}=excl;
end
else
ind2{1,j}=ind;
pairs2{1,j}=[];
excl2{1,j}=[];
end
end
% getting exclusion details
for j=1:numel(boxlist)
if isempty(pairs2{1,j})==0
tmp=pairs2{1,j};
pairdet2{1,j}=[pairs2{1,j} CONF{1,j} SKI{1,j} PERCT{1,j} PERCS{1,j}];
f=find(CONF{1,j}==1&SKI{1,j}==0);
% check if it was deleted
if isempty(excl2{1,j})==0
pairdes2{1,j}=[pairs2{1,j}(f,1) ismember(pairs2{1,j}(f,1),excl2{1,j})...
pairs2{1,j}(f,2) ismember(pairs2{1,j}(f,2),excl2{1,j})...
DES{1,j}(f) DES2{1,j}(f)];
end
else
pairdet2{1,j}=[];
pairdes2{1,j}=[];
end
end
pairdet2_label={'ind1','ind2','confirmed','skipped','temp. simil.','sal. simil.'};
pairdes_label={'ind1','excl1','ind2','excl2','decision1','decision2'};
des1_label={'profile','origin'};
if exist('dlabel1','var')
des1_1_des2label=dlabel1;
des1_2_des2label=dlabel2;
end
clear CONF DES* dlabel* excl EXCL f i IND j PERC* SKI output output_Label
% FILE3
load(file3)
for j=1:numel(boxlist)
indpairs=IND{1,j};
ind=ind2{1,j};
if isempty(indpairs)==0
% get the original index for the pairs
pairs3{1,j}=ind(indpairs);
excl=ind(EXCL{1,j});
if isempty(excl)
ind3{1,j}=ind;
excl3{1,j}=[];
else
tmp=ind;tmp(EXCL{1,j})=[];
ind3{1,j}=tmp;
excl3{1,j}=excl;
end
else
ind3{1,j}=ind;
pairs3{1,j}=[];
excl3{1,j}=[];
end
end
% getting exclusion details
for j=1:numel(boxlist)
if isempty(pairs3{1,j})==0
tmp=pairs3{1,j};
pairdet3{1,j}=[pairs3{1,j} CONF{1,j} SKI{1,j} NEAR{1,j} PERCT{1,j} PERCS{1,j}];
f=find(CONF{1,j}==1&SKI{1,j}==0);
% check if it was deleted
if isempty(excl3{1,j})==0
pairdes3{1,j}=[pairs3{1,j}(f,1) ismember(pairs3{1,j}(f,1),excl3{1,j})...
pairs3{1,j}(f,2) ismember(pairs3{1,j}(f,2),excl3{1,j})...
DES{1,j}(f) DES2{1,j}(f)];
end
else
pairdet3{1,j}=[];
pairdes3{1,j}=[];
end
end
pairdet3_label={'ind1','ind2','confirmed','skipped','near','temp. simil.','sal. simil.'};
clear CONF DES* dlabel* excl NEAR tmp EXCL f i ind indpairs IND j PERC* SKI output output_label
% FILE3
load(file4)
for j=1:numel(boxlist)
indpairs=IND{1,j};
ind=ind3{1,j};
if isempty(indpairs)==0
% get the original index for the pairs
pairs4{1,j}=ind(indpairs);
excl=ind(EXCL{1,j});
if isempty(excl)
ind4{1,j}=ind;
excl4{1,j}=[];
else
tmp=ind;tmp(EXCL{1,j})=[];
ind4{1,j}=tmp;
excl4{1,j}=excl;
end
else
ind4{1,j}=ind;
pairs4{1,j}=[];
excl4{1,j}=[];
end
end
% getting exclusion details
for j=1:numel(boxlist)
if isempty(pairs4{1,j})==0
tmp=pairs4{1,j};
pairdet4{1,j}=[pairs4{1,j} CONF{1,j} SKI{1,j} PERCT{1,j} PERCS{1,j}];
f=find(CONF{1,j}==1&SKI{1,j}==0);
% check if it was deleted
if isempty(excl4{1,j})==0
pairdes4{1,j}=[pairs4{1,j}(f,1) ismember(pairs4{1,j}(f,1),excl4{1,j})...
pairs4{1,j}(f,2) ismember(pairs4{1,j}(f,2),excl4{1,j})...
DES{1,j}(f) DES2{1,j}(f)];
end
else
pairdet4{1,j}=[];
pairdes4{1,j}=[];
end
end
pairdet4_label={'ind1','ind2','confirmed','skipped','temp. simil.','sal. simil.'};
clear CONF DES* dlabel* excl NEAR tmp EXCL f i ind indpairs IND j PERC* SKI output output_label boxlist out
save(fileout)