+ rewrote C interface for SWIG/Python
[qpalma.git] / tools / calculateAlignmentQuality.m
1 load confirmed_sequences.mat;
2 testrun = genes;
3 load /fml/ag-raetsch/share/projects/altsplicedata/zebrafish/confirmed_sequences.mat;
4 ground_truth = genes;
5 clear genes;
6
7 for i = 1:length(ground_truth)
8
9 currentTru = ground_truth(i);
10 currentTruExons = currentTru.exons{1};
11
12 for j = 1:length(testrun)
13 currentPred = testrun(j);
14
15 if strcmp(currentTru.chr,currentPred.chr) && strcmp(currentTru.strands,currentPred.strands)
16 continue;
17 end
18
19 truStart = currentTru.start;
20 truStop = currentTru.stop;
21 predStart = currentPred.start;
22 predStop = currentPred.stop;
23
24 if predStop < truStart || predStart > truStop
25 continue;
26 end
27
28 currentPredExons = currentPred.exons{1};
29
30 rows = size(currentTruExons,1);
31 for ii = 1:rows
32 exonStart = currentTruExons(ii,1);
33 exonStop = currentTruExons(ii,2);
34 for jj = 1:size(currentPredExons,1)
35 predExonStart = currentPredExons(jj,1);
36 predExonStop = currentPredExons(jj,2);
37
38 if exonStart >= predExonStart && exonStart <= predExonStop
39 disp('Overlapping');
40 % end of exonth is nested inside predExoniction
41 elseif exonStop >= predExonStart && exonStop <= predExonStop
42 disp('Overlapping');
43 % predExoniction is nested inside exonth
44 elseif exonStart <= predExonStart && predExonStop <= exonStop
45 disp('Overlapping');
46 else
47 d=1;
48 end
49
50 end
51 end
52 end
53 end