+ extended scripts
[qpalma.git] / scripts / Evaluation.py
index 96518bb..5156d8f 100644 (file)
@@ -85,18 +85,36 @@ def prediction_on(filename):
    allWrongExons  = []
    allDoubleScores = []
 
+   ctr = 0
+
    for current_example_pred in allPredictions:
       ambigous_match = False
       if len(current_example_pred) > 1:
          ambigous_match = True
          example_scores = []
 
-      for current_pred in current_example_pred:
+      for elem_nr,current_pred in enumerate(current_example_pred):
          e1_b_off = current_pred['e1_b_off']
          e1_e_off = current_pred['e1_e_off']
          e2_b_off = current_pred['e2_b_off']
          e2_e_off = current_pred['e2_e_off']
 
+         if elem_nr > 0:
+            #print 'start positions'
+            #print current_pred['start_pos'], current_pred['alternative_start_pos']
+
+            if current_pred['label'] == False or (current_pred['label'] == True
+            and len(current_pred['predExons']) != 4):
+               if current_pred['DPScores'].flatten().tolist()[0][0] <\
+               current_example_pred[0]['DPScores'].flatten().tolist()[0][0]:
+                  print current_pred['trueExons'][0,1]-current_pred['trueExons'][0,0],\
+                  current_pred['trueExons'][1,1]-current_pred['trueExons'][1,0],\
+                  current_pred['predExons']
+                  print current_pred['DPScores'].flatten().tolist()[0][0],\
+                  current_example_pred[0]['DPScores'].flatten().tolist()[0][0]
+                  ctr += 1
+                  print ctr
+
          if e1_b_off != None:
             exon1Begin.append(e1_b_off)
             exon1End.append(e1_e_off)