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

index 78cf9df..60c65d6 100644 (file)
@@ -46,6 +46,31 @@ def calculateWeights(plf, scores):
 
    return currentWeight
 
+def calculatePlif(plf, scores):
+   plifed_scores=[] ;
+   
+   for k in range(len(scores)):
+      value = scores[k]
+
+      Lower = 0
+      for elem in plf.limits:
+          if elem<=value:
+              Lower+=1 
+
+      if Lower == 0:
+          plifed_scores.append(plf.penalties[0])
+      elif Lower == len(plf.limits):
+          plifed_scores.append(plf.penalties[-1])
+      else:
+         Lower -= 1
+         Upper = Lower+1 ;
+         weightup  = 1.0*(value - plf.limits[Lower]) / (plf.limits[Upper] - plf.limits[Lower])
+         weightlow = 1.0*(plf.limits[Upper] - value) / (plf.limits[Upper] - plf.limits[Lower])
+
+         plifed_scores.append( plf.penalties[Upper]*weightup + plf.penalties[Lower]*weightlow )
+
+   return plifed_scores 
+
 def computeSpliceWeights(d, a, h, SpliceAlign, don_supp, acc_supp):
    ####################################################################################
    # 1. Donor: In don_supp stehen Werte der SVM., in SpliceAlign die Einsen
index d8be02c..59c2aa7 100644 (file)
@@ -333,6 +333,11 @@ class PipelineHeuristic:
       mmatrix = self.mmatrix
       qualityPlifs = self.qualityPlifs
       # inlined
+
+      h.limits
+      intronScore = calculatePlif(h, [90])[0] 
+      acceptorScore = calculatePlif(a, [0.8])[0] 
+      
       
       _start = cpu()
       for don_pos in alt_don_pos: