hmmer-3.3/src/p7_trace.c
/* Function:  p7_trace_AppendWithPP()
 * Synopsis:  Add element to growing trace, with posterior probability.
 *
 * Purpose:   Same as <p7_trace_Append()>, but also records a posterior
 *            probability estimate for emitted residues. <pp> is assumed to be
 *            zero for nonemitting states even if a nonzero argument is
 *            mistakenly passed. 
 */
p7_trace_AppendWithPP()
Synopsis:  Add element to growing trace, with posterior probability.

Same as , but also records a posterior
probability estimate for emitted residues.  is assumed to be
zero for nonemitting states even if a nonzero argument is
mistakenly passed.
p7_trace_AppendWithPP () Synopsis : Add element to growing trace with posterior probability . Same as but also records a posterior probability estimate for emitted residues . is assumed to be zero for nonemitting states even if a nonzero argument is mistakenly passed .
int
p7_trace_AppendWithPP(P7_TRACE *tr, char st, int k, int i, float pp)
{
  int status;
  if ((status = p7_trace_Grow(tr)) != eslOK) return status;
  switch (st) {
  case p7T_N: 
  case p7T_C: 
  case p7T_J:
    if (tr->st[tr->N-1] == st) 
      {
	tr->i[tr->N]  = i; 
	tr->pp[tr->N] = pp;
      }
    else
      {
	tr->i[tr->N]  = 0; 
	tr->pp[tr->N] = 0.0;
      }
    tr->k[tr->N] = 0; 
    break;
  case p7T_X:
  case p7T_S:
  case p7T_B:
  case p7T_E:
  case p7T_T: tr->i[tr->N] = 0; tr->pp[tr->N] = 0.0; tr->k[tr->N] = 0; break;
  case p7T_D: tr->i[tr->N] = 0; tr->pp[tr->N] = 0.0; tr->k[tr->N] = k; break;
  case p7T_M: 
  case p7T_I: tr->i[tr->N] = i; tr->pp[tr->N] = pp;  tr->k[tr->N] = k; break;
  default:    ESL_EXCEPTION(eslEINVAL, "no such state; can't append");
  }
  tr->st[tr->N] = st;
  tr->N++;
  return eslOK;
}
int p7_trace_AppendWithPP ( P7_TRACE * tr , char st , int k , int i , float pp ) { int status ; if ( ( status = p7_trace_Grow ( tr ) ) != eslOK ) return status ; switch ( st ) { case p7T_N : case p7T_C : case p7T_J : if ( tr -> st [ tr -> N - 1 ] == st ) { tr -> i [ tr -> N ] = i ; tr -> pp [ tr -> N ] = pp ; } else { tr -> i [ tr -> N ] = 0 ; tr -> pp [ tr -> N ] = 0.0 ; } tr -> k [ tr -> N ] = 0 ; break ; case p7T_X : case p7T_S : case p7T_B : case p7T_E : case p7T_T : tr -> i [ tr -> N ] = 0 ; tr -> pp [ tr -> N ] = 0.0 ; tr -> k [ tr -> N ] = 0 ; break ; case p7T_D : tr -> i [ tr -> N ] = 0 ; tr -> pp [ tr -> N ] = 0.0 ; tr -> k [ tr -> N ] = k ; break ; case p7T_M : case p7T_I : tr -> i [ tr -> N ] = i ; tr -> pp [ tr -> N ] = pp ; tr -> k [ tr -> N ] = k ; break ; default : ESL_EXCEPTION ( eslEINVAL , " " ) ; } tr -> st [ tr -> N ] = st ; tr -> N ++ ; return eslOK ; }
Function:  p7_trace_AppendWithPP()
 Synopsis:  Add element to growing trace, with posterior probability.
Function : p7_trace_AppendWithPP () Synopsis : Add element to growing trace with posterior probability .
/* Emit-on-transition states: */ /* Nonemitting states, outside main model: */ /* Nonemitting, but in main model (k valid) */ /* Emitting states, with valid k position in model: */