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_ScoreHeights (P7_HMM *hmm, P7_BG *bg, float **heights ) {
  int    K     = hmm->abc->K;
  int    M     = hmm->M;
  int    i, j;
  float p;
  float logodds;
  for (i = 1; i <= M; i++) {
    for (j=0; j<K; j++) {
      p       = hmm->mat[i][j];
      logodds = eslCONST_LOG2R * log(p / bg->f[j]);  
      heights[i][j] = logodds;
    }
  }
  return eslOK;
}
int hmmlogo_ScoreHeights ( P7_HMM * hmm , P7_BG * bg , float * * heights ) { int K = hmm -> abc -> K ; int M = hmm -> M ; int i , j ; float p ; float logodds ; for ( i = 1 ; i <= M ; i ++ ) { for ( j = 0 ; j < K ; j ++ ) { p = hmm -> mat [ i ] [ j ] ; logodds = eslCONST_LOG2R * log ( p / bg -> f [ j ] ) ; heights [ i ] [ j ] = logodds ; } } return eslOK ; }
assumes heights is allocated with hmm->M floats
assumes heights is allocated with hmm - > M floats
// height of column, to be split among the residues; also sum of of positive scores //bits