deps/kb_meme/meme-5.0.1/src/mhmm.c
/*************************************************************************
 * Setup motif-to-motif occurrence and spacer length frequency
 * transition matrices in a naive fashion, without taking into account
 * any motif occurrence information.
 *************************************************************************/
Setup motif-to-motif occurrence and spacer length frequency
transition matrices in a naive fashion, without taking into account
any motif occurrence information.
Setup motif - to - motif occurrence and spacer length frequency transition matrices in a naive fashion without taking into account any motif occurrence information .
static void compute_naive_transitions_and_spacers
  (const int  nmotifs,     
   MATRIX_T** transp_freq, 
   MATRIX_T** spacer_ave)  
{
  int   i;
  int   j;
  PROB_T prob;
  *transp_freq = allocate_matrix(nmotifs + 2, nmotifs + 2);
  *spacer_ave = allocate_matrix(nmotifs + 2, nmotifs + 2);
  prob = 1.0 / (PROB_T)nmotifs;
  for (j = 1; j <= nmotifs; j++) {
    set_matrix_cell(0, j, prob, *transp_freq);
    set_matrix_cell(0, j, SPACER_LENGTH, *spacer_ave);
  }
  prob = 1.0 / ((PROB_T)(nmotifs + 1));
  for (i = 1; i <= nmotifs; i++) {
    for (j = 1; j <= nmotifs+1; j++) {
      set_matrix_cell(i, j, prob, *transp_freq);
      set_matrix_cell(i, j, SPACER_LENGTH, *spacer_ave);
    }
  }
}
static void compute_naive_transitions_and_spacers ( const int nmotifs , MATRIX_T * * transp_freq , MATRIX_T * * spacer_ave ) { int i ; int j ; PROB_T prob ; * transp_freq = allocate_matrix ( nmotifs + 2 , nmotifs + 2 ) ; * spacer_ave = allocate_matrix ( nmotifs + 2 , nmotifs + 2 ) ; prob = 1.0 / ( PROB_T ) nmotifs ; for ( j = 1 ; j <= nmotifs ; j ++ ) { set_matrix_cell ( 0 , j , prob , * transp_freq ) ; set_matrix_cell ( 0 , j , SPACER_LENGTH , * spacer_ave ) ; } prob = 1.0 / ( ( PROB_T ) ( nmotifs + 1 ) ) ; for ( i = 1 ; i <= nmotifs ; i ++ ) { for ( j = 1 ; j <= nmotifs + 1 ; j ++ ) { set_matrix_cell ( i , j , prob , * transp_freq ) ; set_matrix_cell ( i , j , SPACER_LENGTH , * spacer_ave ) ; } } }
Setup motif-to-motif occurrence and spacer length frequency
 transition matrices in a naive fashion, without taking into account
 any motif occurrence information.
Setup motif - to - motif occurrence and spacer length frequency transition matrices in a naive fashion without taking into account any motif occurrence information .
// The number of motifs. // Motif-to-motif occurrence matrix. // Average spacer length matrix. // Allocate the matrices. // Set up transition frequencies and spacer lengths from start state. /* Set up transition frequencies and spacer lengths between motifs
     and to the end state. */