JWS-112 Bumping version of ClustalO (src, binaries and windows) to version 1.2.4.
[jabaws.git] / binaries / src / clustalo / src / hhalign / hhfunc-C.h
index 5de3a58..8b4152b 100644 (file)
@@ -15,7 +15,7 @@
  ********************************************************************/
 
 /*
- *  RCS $Id: hhfunc-C.h 256 2011-06-23 13:57:28Z fabian $
+ *  RCS $Id: hhfunc-C.h 309 2016-06-13 14:10:11Z fabian $
  */
 
 /*
@@ -29,6 +29,7 @@
 
 // hhfunc.C
 
+//#include "new_new.h" /* memory tracking */
 
 /**
  * AddBackgroundFrequencies()
@@ -68,21 +69,14 @@ AddBackgroundFrequencies(float **ppfFreq, float **ppfPseudoF, float **ppfPseudoT
     int iS = 0; /* position in un-aligned sequence (corresponds to pcS) */
     int iH = 0; /* position in un-aligned HMM (corresponds to pcH) */
     int iA; /* residue iterator */
-    int iT; /* transition state iterator */
+    //int iT; /* transition state iterator */
     float fFWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud frequencies */ /* FIXME: tune value, 0.50 default */
     //float fFWeight = 0.75;
     float fFThgiew = UNITY - fFWeight; /* weight of 'true' frequencies */
-    float fGWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */
+    //float fGWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */
     //float fGWeight = 0.50 /*/ (float)(iPreCnt)*/; /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */
-    float fGThgiew = UNITY - fGWeight; /* weight of 'true' transitions */
+    //float fGThgiew = UNITY - fGWeight; /* weight of 'true' transitions */
     float fAux; 
-    /* zf1SeqTrans[] are the (phenomenological) transition probabilities (+ pseudo-counts)
-       for a single sequence. It is almost certain (0.99) to stay in a match state, and very 
-    unlikely (0.05) to go from match to insertion/deletion */
-    float zf1SeqTrans[] = {0.98, 0.01, 0.01, 0.25, 0.75, 0.25, 0.75};
-    float zf1SeqInit[]  = {0.98, 0.01, 0.01, 0.99, 0.01, 0.99, 0.01};
-    float zf1SeqDel[]   = {0.24, 0.01, 0.75, 0.01, 0.01, 0.01, 0.01};
-    float zf1SeqRevrt[] = {0.98, 0.01, 0.01, 0.01, 0.01, 0.99, 0.01};
 
     if ( (NULL == pcPrealigned) || (NULL == pcRepresent) ){
         /*printf("%s/%s:%d: WARNING HMM=NULL -- didn't think I would get here (carry on, no danger)\n",
@@ -225,7 +219,7 @@ AddBackgroundFrequencies(float **ppfFreq, float **ppfPseudoF, float **ppfPseudoT
  *
  * @param[in] iRnPtype
  * type of read/prepare 
- * enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM};
+ * enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM, INTERN_HMM_2_HMM};
  * @param[in] ppcProf 
  * alignment
  * @param[in] iCnt
@@ -322,7 +316,6 @@ ReadAndPrepare(int iRnPtype,
           prHMM->seq[prHMM->ncons][0] = q.seq[q.ncons][0] = cHead;
       }
 #endif
-      const int NEFF_SCORE = 10; /* FIXME: Magic Number */
       for (int i = 0; i < prHMM->L+1; i++){
           q.Neff_M[i] = prHMM->Neff_M[i];
           q.Neff_I[i] = prHMM->Neff_I[i];
@@ -391,7 +384,7 @@ ReadAndPrepare(int iRnPtype,
                   cout<<"WARNING! Use of HMMER3 format as input results in dramatically loss of sensitivity!\n";
               }
               
-              // Read 'query HMMER file                                                                                            
+              // Read 'query HMMER file
               rewind(inf);
               q.ReadHMMer3(inf,path);
 
@@ -505,13 +498,9 @@ ReadAndPrepare(int iRnPtype,
       prHMM->L          = q.L;
       prHMM->N_in       = q.N_in;
       prHMM->N_filtered = q.N_filtered;
-      const int NEFF_SCORE = 10; /* FIXME: Magic Number */
       prHMM->Neff_M = (float *)calloc(prHMM->L+1, sizeof(float));
       prHMM->Neff_I = (float *)calloc(prHMM->L+1, sizeof(float));
       prHMM->Neff_D = (float *)calloc(prHMM->L+1, sizeof(float));
-      /*for (int i = 0; i < prHMM->L+1; i++){
-        prHMM->Neff_M[i] = prHMM->Neff_I[i] = prHMM->Neff_D[i] = NEFF_SCORE;
-        }*/
       prHMM->Neff_HMM = q.Neff_HMM;
       /* skip longname,name,file,fam,sfam,fold,cl */
       prHMM->lamda = q.lamda;
@@ -839,11 +828,10 @@ CompDblAsc(const void *pv1, const void *pv2){
  *
  */
 extern "C" int
-AlnToHMM2(hmm_light *rHMM_p,
-              char **ppcSeq, int iN){
-
+AlnToHMM2(hmm_light *rHMM_p, hhalign_para rHhalignPara, 
+          char **ppcSeq, int iN){
     if (0 == par.M){
-        SetDefaults();
+        SetDefaults(rHhalignPara);
         SetSubstitutionMatrix();
         par.cons = 1;
         par.M = 2;
@@ -1154,7 +1142,7 @@ readHMMWrapper(hmm_light *rHMM_p,
             } /* (0 <= iA < AMINOACIDS) */
             rHMM_p->seq[rHMM_p->ncons][i] = i2aa(iAmax);
         } /* (0 <= i < rHMM_p->L) */
-
+        rHMM_p->seq[rHMM_p->ncons][i] = '\0'; /* FS, r291 -> */
     } /* ncons not set */