git-svn-id: http://svn.tuebingen.mpg.de/ag-raetsch/projects/QPalma@8632 e1793c9e...
authorraetsch <raetsch@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Thu, 17 Apr 2008 21:09:50 +0000 (21:09 +0000)
committerraetsch <raetsch@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Thu, 17 Apr 2008 21:09:50 +0000 (21:09 +0000)
scripts/PipelineHeuristic.py

index 4b381d6..ad46368 100644 (file)
@@ -270,7 +270,8 @@ class PipelineHeuristic:
              break 
 
       acc.sort(lambda x,y: x[0]-y[0]) 
-
+      acc=acc[-2:]
+      
       don   = []
       for idx,score in enumerate(currentDon):
          if score > -inf:
@@ -279,6 +280,7 @@ class PipelineHeuristic:
              break 
 
       don.sort(lambda x,y: x[0]-y[0]) 
+      don=don[-2:]
 
       return don,acc
 
@@ -339,10 +341,10 @@ class PipelineHeuristic:
       IntronScore = calculatePlif(h, [self.intron_size+1])[0]
       dummyAcceptorScore = calculatePlif(a, [0.25])[0] 
       dummyDonorScore = calculatePlif(d, [0.25])[0]
-      print IntronScore,dummyAcceptorScore,dummyDonorScore
       
       _start = cpu()
       for (don_pos,don_score) in alt_don:
+         """
          start = cpu()
 
          acc_pos = don_pos + self.intron_size
@@ -400,10 +402,15 @@ class PipelineHeuristic:
          start = cpu()
 
          trueWeight = numpy.vstack([trueWeightIntron, trueWeightDon, trueWeightAcc, trueWeightMatch, trueWeightQuality])
+         stop = cpu()
+         self.DotProdTime += stop-start
 
          # Calculate w'phi(x,y) the total score of the alignment
          alternativeScores.append((trueWeight.T * self.currentPhi)[0,0])
+         """
 
+         # new score computation
+         
          # remove mismatching positions in the second exon
          original_est_cut=''
 
@@ -438,19 +445,14 @@ class PipelineHeuristic:
          assert(dna_ptr<=len(dna))
          assert(est_ptr<=len(est))
 
-         print original_est, original_est_cut
-         
-         # new score
          DonorScore = calculatePlif(d, [don_score])[0]
-         #print 'don: %f,%f' % (DonorScore, don_score)
+         print DonorScore,don_score
          
          score = computeSpliceAlignScoreWithQuality(original_est_cut, quality, qualityPlifs, run, self.currentPhi)
          score += dummyAcceptorScore + IntronScore + DonorScore
          
-         print 'diff %f,%f,%f' % ((trueWeight.T * self.currentPhi)[0,0] - score,(trueWeight.T * self.currentPhi)[0,0], score)
-
-         stop = cpu()
-         self.DotProdTime += stop-start
+         #print 'diff %f,%f,%f' % ((trueWeight.T * self.currentPhi)[0,0] - score,(trueWeight.T * self.currentPhi)[0,0], score)
+         alternativeScores.append(score)
 
       _stop = cpu()
       self.alternativeScoresTime += _stop-_start