hmmer-3.3/src/hmmlogo.c
/* assumes heights is allocated with hmm->M floats*/
assumes heights is allocated with hmm->M floats
assumes heights is allocated with hmm - > M floats
int
hmmlogo_IndelValues (P7_HMM *hmm, float *insert_P, float *insert_expL, float *occupancy ) {
  int    i;
  if (insert_P != NULL)    insert_P[1]    = hmm->t[1][p7H_MI];                   
  if (insert_expL != NULL) insert_expL[1] =  1 / (1 - hmm->t[1][p7H_II]) ;       
  for (i = 2; i < hmm->M; i++) {
    if (insert_P != NULL)    insert_P[i]    = hmm->t[i][p7H_MI];                         
    if (insert_expL != NULL) insert_expL[i] =  1 / (1 - hmm->t[i][p7H_II]) ;          
  }
  if (insert_P != NULL)    insert_P[hmm->M]    = 0.0;   
  if (insert_expL != NULL) insert_expL[hmm->M] = 0.0;   
  if (occupancy != NULL)  p7_hmm_CalculateOccupancy(hmm, occupancy, NULL);
  return eslOK;
}
int hmmlogo_IndelValues ( P7_HMM * hmm , float * insert_P , float * insert_expL , float * occupancy ) { int i ; if ( insert_P != NULL ) insert_P [ 1 ] = hmm -> t [ 1 ] [ p7H_MI ] ; if ( insert_expL != NULL ) insert_expL [ 1 ] = 1 / ( 1 - hmm -> t [ 1 ] [ p7H_II ] ) ; for ( i = 2 ; i < hmm -> M ; i ++ ) { if ( insert_P != NULL ) insert_P [ i ] = hmm -> t [ i ] [ p7H_MI ] ; if ( insert_expL != NULL ) insert_expL [ i ] = 1 / ( 1 - hmm -> t [ i ] [ p7H_II ] ) ; } if ( insert_P != NULL ) insert_P [ hmm -> M ] = 0.0 ; if ( insert_expL != NULL ) insert_expL [ hmm -> M ] = 0.0 ; if ( occupancy != NULL ) p7_hmm_CalculateOccupancy ( hmm , occupancy , NULL ) ; return eslOK ; }
assumes heights is allocated with hmm->M floats
assumes heights is allocated with hmm - > M floats
//probability of inserting after this match //expected length of the insert, if it happens //  if (delete_P != NULL)    delete_P[1]    = 0.0;  //1st match state never deleted //probability of inserting after this match //expected length of the insert, if it happens //    if (delete_P != NULL)    delete_P[i]    = ( (1.0-delete_P[i-1]) * hmm->t[i-1][p7H_MD] ) + ( delete_P[i-1] * hmm->t[i-1][p7H_DD]) ; //probability of missing this state, either due to DD or MD from previous position //no inserts after final position //no inserts after final position //  if (delete_P != NULL)    delete_P[hmm->M]    = ( (1.0-delete_P[hmm->M-1]) * hmm->t[hmm->M-1][p7H_MD] ) + ( delete_P[hmm->M-1] * hmm->t[hmm->M-1][p7H_DD]) ; //probability of missing this state, either due to DD or MD from previous position