hmmer-3.3/src/p7_trace.c
/* Function:  p7_trace_Compare()
 * Synopsis:  Compare two traces for identity
 * Incept:    SRE, Wed Aug 20 09:05:24 2008 [Janelia]
 *
 * Purpose:   Compare two tracebacks; return <eslOK> if they
 *            are identical, <eslFAIL> if not.
 *            
 *            If posterior probability annotation is present in 
 *            both traces, they are compared using <esl_FCompare()>
 *            and a relative tolerance of <pptol>.
 *            
 *            If domain indices are present in both traces,
 *            the two indexes are compared.
 */
p7_trace_Compare()
Synopsis:  Compare two traces for identity
Incept:    SRE, Wed Aug 20 09:05:24 2008 [Janelia]

Compare two tracebacks; return  if they
are identical,  if not.

If posterior probability annotation is present in
both traces, they are compared using 
and a relative tolerance of .

If domain indices are present in both traces,
the two indexes are compared.
p7_trace_Compare () Synopsis : Compare two traces for identity Incept : SRE Wed Aug 20 09 : 05 : 24 2008 [ Janelia ] Compare two tracebacks ; return if they are identical if not . If posterior probability annotation is present in both traces they are compared using and a relative tolerance of . If domain indices are present in both traces the two indexes are compared .
int
p7_trace_Compare(P7_TRACE *tr1, P7_TRACE *tr2, float pptol)
{
  int z,d;
  if (tr1->N != tr2->N) esl_fatal("FAIL");
  if (tr1->M != tr2->M) esl_fatal("FAIL");
  if (tr1->L != tr2->L) esl_fatal("FAIL");
  for (z = 0; z < tr1->N; z++)
    {
      if (tr1->st[z] != tr2->st[z]) esl_fatal("FAIL");
      if (tr1->k[z]  != tr2->k[z])  esl_fatal("FAIL");
      if (tr1->i[z]  != tr2->i[z])  esl_fatal("FAIL");
    }
  if (tr1->pp != NULL && tr2->pp != NULL)
    {
      for (z = 0; z < tr1->N; z++)
	if (tr1->i[z] != 0) 	
	  {
	    if (esl_FCompare(tr1->pp[z], tr2->pp[z], pptol) != eslOK) esl_fatal("FAIL");
	  }
	else
	  {
	    if (tr1->pp[z] != tr2->pp[z]) esl_fatal("FAIL"); 
	  }
    }
  if (tr1->ndom > 0 && tr2->ndom > 0)
    {
      if (tr1->ndom != tr2->ndom) esl_fatal("FAIL");
      for (d = 0; d < tr1->ndom; d++)
	{
	  if (tr1->tfrom[d]   != tr2->tfrom[d])    esl_fatal("FAIL");
	  if (tr1->tto[d]     != tr2->tto[d])      esl_fatal("FAIL");
	  if (tr1->sqfrom[d]  != tr2->sqfrom[d])   esl_fatal("FAIL");
	  if (tr1->sqto[d]    != tr2->sqto[d])     esl_fatal("FAIL");
	  if (tr1->hmmfrom[d] != tr2->hmmfrom[d])  esl_fatal("FAIL");
	  if (tr1->hmmto[d]   != tr2->hmmto[d])    esl_fatal("FAIL");
	}
    }
  return eslOK;
}
int p7_trace_Compare ( P7_TRACE * tr1 , P7_TRACE * tr2 , float pptol ) { int z , d ; if ( tr1 -> N != tr2 -> N ) esl_fatal ( " " ) ; if ( tr1 -> M != tr2 -> M ) esl_fatal ( " " ) ; if ( tr1 -> L != tr2 -> L ) esl_fatal ( " " ) ; for ( z = 0 ; z < tr1 -> N ; z ++ ) { if ( tr1 -> st [ z ] != tr2 -> st [ z ] ) esl_fatal ( " " ) ; if ( tr1 -> k [ z ] != tr2 -> k [ z ] ) esl_fatal ( " " ) ; if ( tr1 -> i [ z ] != tr2 -> i [ z ] ) esl_fatal ( " " ) ; } if ( tr1 -> pp != NULL && tr2 -> pp != NULL ) { for ( z = 0 ; z < tr1 -> N ; z ++ ) if ( tr1 -> i [ z ] != 0 ) { if ( esl_FCompare ( tr1 -> pp [ z ] , tr2 -> pp [ z ] , pptol ) != eslOK ) esl_fatal ( " " ) ; } else { if ( tr1 -> pp [ z ] != tr2 -> pp [ z ] ) esl_fatal ( " " ) ; } } if ( tr1 -> ndom > 0 && tr2 -> ndom > 0 ) { if ( tr1 -> ndom != tr2 -> ndom ) esl_fatal ( " " ) ; for ( d = 0 ; d < tr1 -> ndom ; d ++ ) { if ( tr1 -> tfrom [ d ] != tr2 -> tfrom [ d ] ) esl_fatal ( " " ) ; if ( tr1 -> tto [ d ] != tr2 -> tto [ d ] ) esl_fatal ( " " ) ; if ( tr1 -> sqfrom [ d ] != tr2 -> sqfrom [ d ] ) esl_fatal ( " " ) ; if ( tr1 -> sqto [ d ] != tr2 -> sqto [ d ] ) esl_fatal ( " " ) ; if ( tr1 -> hmmfrom [ d ] != tr2 -> hmmfrom [ d ] ) esl_fatal ( " " ) ; if ( tr1 -> hmmto [ d ] != tr2 -> hmmto [ d ] ) esl_fatal ( " " ) ; } } return eslOK ; }
Function:  p7_trace_Compare()
 Synopsis:  Compare two traces for identity
 Incept:    SRE, Wed Aug 20 09:05:24 2008 [Janelia]
Function : p7_trace_Compare () Synopsis : Compare two traces for identity Incept : SRE Wed Aug 20 09 : 05 : 24 2008 [ Janelia ]
/* Main data in the trace */ /* Optional posterior probability annotation */ /* an emission: has a nonzero posterior prob*/ /* both 0.0 */ /* Optional domain index */