git-svn-id: http://svn.tuebingen.mpg.de/ag-raetsch/projects/QPalma@8592 e1793c9e...
authorraetsch <raetsch@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Thu, 17 Apr 2008 19:21:49 +0000 (19:21 +0000)
committerraetsch <raetsch@e1793c9e-67f9-0310-80fc-b846ff1f7b36>
Thu, 17 Apr 2008 19:21:49 +0000 (19:21 +0000)
qpalma/computeSpliceAlignWithQuality.py

index 0863560..0b13e28 100644 (file)
@@ -219,15 +219,15 @@ def  computeSpliceAlignScoreWithQuality(dna, exons, est, original_est, quality,
                dnaletter=original_est[ptr+2][ptr]
                estletter=dnaletter
                ptr+=1
                dnaletter=original_est[ptr+2][ptr]
                estletter=dnaletter
                ptr+=1
-           if est_letter=='-':
+           if estletter=='-':
                score+= mmatrixP[dna_letter]
                dna_ptr+=1 
            else:
                score+= mmatrixP[dna_letter]
                dna_ptr+=1 
            else:
-               est_qual = quality[est_ptr]
-
+               value = quality[est_ptr]
                cur_plf = qualityPlifs[(estnum-1)*6+dnanum]
                
                cur_plf = qualityPlifs[(estnum-1)*6+dnanum]
                
-               Lower = len([elem for elem in cur_plf.limits if elem <= value])
+               Lower = 0
+               for elem in cur_plf.limits: if elem<=value: Lower+=1 
                
                if Lower == 0:
                    score += numqP[(estletter-1)*6*numQualSuppPoints + dnaletter*numQualSuppPoints+0] ;
                
                if Lower == 0:
                    score += numqP[(estletter-1)*6*numQualSuppPoints + dnaletter*numQualSuppPoints+0] ;
@@ -246,9 +246,9 @@ def  computeSpliceAlignScoreWithQuality(dna, exons, est, original_est, quality,
                    score += numqP[(estletter-1)*6*numQualSuppPoints + dnaletter*numQualSuppPoints+Upper]*weightup ;
                    score += numqP[(estletter-1)*6*numQualSuppPoints + dnaletter*numQualSuppPoints+Lower]*weightlow ;
                                   
                    score += numqP[(estletter-1)*6*numQualSuppPoints + dnaletter*numQualSuppPoints+Upper]*weightup ;
                    score += numqP[(estletter-1)*6*numQualSuppPoints + dnaletter*numQualSuppPoints+Lower]*weightlow ;
                                   
-           if est_letter=='-':
+           if estletter=='-':
                dna_ptr+=1 
                dna_ptr+=1 
-           elif dna_letter=='-':
+           elif dnaletter=='-':
                est_ptr+=1
            else:
                dna_ptr+=1 
                est_ptr+=1
            else:
                dna_ptr+=1