+ parameter transfer to python layer works
[qpalma.git] / tools / calculateAlignmentQuality.m
index 0338a4b..bab0263 100644 (file)
@@ -9,13 +9,20 @@ load /fml/ag-raetsch/share/projects/altsplicedata/zebrafish/confirmed_sequences.
 ground_truth = genes;
 clear genes;
 
-fh = fopen('overlapping.pos','w+')
+disp('Loaded data...');
+
+fh = fopen('overlapping.pos','w+');
+
 for i = 1:length(ground_truth)
    currentEntry = ground_truth(i);
    currentExons = currentEntry.exons;
    assert (length(currentEntry.transcripts) == length(currentEntry.exons));
    numberOfEsts = length(currentEntry.transcripts);
 
+   if mod(i,100) == 0
+      fprintf('.')
+   end
+
    for j = 1:length(testrun)
       currentPred = testrun(j);
 
@@ -58,18 +65,17 @@ for i = 1:length(ground_truth)
                   %%disp(sprintf('%i %i %i %i %i %i\n',i,j,estIdx,predEstIdx,exonIdx,predExonIdx));
                
                   % est is covering full intron
-                  if intronStart >= predExonStart && intronStop <= predExonStop
-                     fprintf(fh,sprintf(' %s is completely overlapping from %d %d\n',currentESTName,intronStart,intronStop))
+                  if intronStart > predExonStart && intronStop < predExonStop
+                     fprintf(fh,sprintf(' %s is completely overlapping from %d %d\n',currentESTName,intronStart,intronStop));
                   % est is nested inside intron
-                  if intronStart < predExonStart && intronStop > predExonStop
-                     fprintf(fh,sprintf(' %s is completely inside intron from %d %d\n',currentESTName,predExonStart,predExonStop))
+                  elseif intronStart < predExonStart && intronStop > predExonStop
+                     fprintf(fh,sprintf(' %s is completely inside intron from %d %d\n',currentESTName,predExonStart,predExonStop));
                   % end of exonth is nested inside predExoniction
-                  elseif intronStart >= predExonStart && predExonStop >= intronStart && intronStop >= predExonStop
-                     fprintf(fh,sprintf('%s is upstream overlapping from %d %d\n',currentESTName,intronStart,predExonStop))
+                  elseif intronStart > predExonStart && predExonStop > intronStart && intronStop > predExonStop
+                     fprintf(fh,sprintf('%s is upstream overlapping from %d %d\n',currentESTName,intronStart,predExonStop));
                   % predExoniction is nested inside exonth
-                  elseif intronStart <= predExonStart && predExonStart <= intronStop && intronStop <= predExonStop
-                     fprintf(fh,sprintf('%s is downstream overlapping from %d %d\n',currentESTName,predExonStart,intronStop))
-                     fprintf('%s %d %d',fh)
+                  elseif intronStart < predExonStart && predExonStart < intronStop && intronStop < predExonStop
+                     fprintf(fh,sprintf('%s is downstream overlapping from %d %d\n',currentESTName,predExonStart,intronStop));
                   else
                      d=1;
                   end