+ parameter transfer to python layer works
[qpalma.git] / QPalmaDP / result_align.cpp
index 99b3238..5f2a054 100644 (file)
@@ -5,7 +5,12 @@ using namespace std;
 
 void increaseFeatureCount(penalty_struct* qparam, int dnanum, int estnum, double estprb) {
 
-   penalty_struct currentStruct = qparam[estnum*6+dnanum];
+   if(dnanum == 0) {
+      return;
+   }
+
+   penalty_struct currentStruct = qparam[(estnum-1)*6+(dnanum-1)];
+   //printf("check_char is %d\n",(estnum-1)*6+(dnanum-1));
 
    double value = estprb;
    int Lower = 0;
@@ -106,7 +111,7 @@ bool result_align(Pre_score* matrices[], int z, int est_len, int dna_len, int* r
 
       prbnum = prb[i-1];
       chastitynum = chastity[i-1];
-      //increaseFeatureCount(qparam,dnanum,estnum,prbnum);
+      increaseFeatureCount(qparam,dnanum,estnum,prbnum);
 
       mparam[mlen*dnanum +estnum] ++ ;
     }
@@ -131,7 +136,7 @@ bool result_align(Pre_score* matrices[], int z, int est_len, int dna_len, int* r
 
       prbnum = prb[i-1];
       chastitynum = chastity[i-1];
-      //increaseFeatureCount(qparam,dnanum,estnum,prbnum);
+      increaseFeatureCount(qparam,dnanum,estnum,prbnum);
 
       mparam[mlen*dnanum +estnum] ++ ;
     }