deps/kb_meme/meme-5.0.1/src/starts.c
/**
 * Use the specified consensus string as the EM seed, for all nsites values.
 */
Use the specified consensus string as the EM seed, for all nsites values.
Use the specified consensus string as the EM seed for all nsites values .
static void use_input_cons(
  ALPH_T *alph, 		
  SP_MATRIX *sp_matrix,		
  uint8_t *e_cons 		
)
{
  int w_idx, n_idx, lett_idx;
  int n_widths = get_num_central_widths(sp_matrix);
  int n_nsites = get_num_central_nsites(sp_matrix);
  int *central_ws = get_central_ws(sp_matrix);
  int *central_ns = get_central_ns(sp_matrix);
  for (w_idx = 0; w_idx < n_widths; w_idx++){
    int curr_w = central_ws[w_idx];
    for (n_idx = 0; n_idx < n_nsites; n_idx++){
      int curr_ns = central_ns[n_idx];
      S_POINT *curr_sp = get_s_point(sp_matrix, curr_w, curr_ns);
      curr_sp->e_cons0 = mm_malloc(sizeof(uint8_t) * MAXSITE);
      memcpy(curr_sp->e_cons0, e_cons, sizeof(uint8_t) * MAXSITE);
      curr_sp->score = 1.0;
      curr_sp->iseq = -1;
      curr_sp->ioff = -1;
      for (lett_idx = 0; lett_idx < curr_w; lett_idx++){
        curr_sp->cons0[lett_idx] = 
          (e_cons ? alph_char(alph, e_cons[lett_idx]) : alph_wildcard(alph));
      } 
      curr_sp->cons0[lett_idx] = '\0';
    } 
  } 
}
static void use_input_cons ( ALPH_T * alph , SP_MATRIX * sp_matrix , uint8_t * e_cons ) { int w_idx , n_idx , lett_idx ; int n_widths = get_num_central_widths ( sp_matrix ) ; int n_nsites = get_num_central_nsites ( sp_matrix ) ; int * central_ws = get_central_ws ( sp_matrix ) ; int * central_ns = get_central_ns ( sp_matrix ) ; for ( w_idx = 0 ; w_idx < n_widths ; w_idx ++ ) { int curr_w = central_ws [ w_idx ] ; for ( n_idx = 0 ; n_idx < n_nsites ; n_idx ++ ) { int curr_ns = central_ns [ n_idx ] ; S_POINT * curr_sp = get_s_point ( sp_matrix , curr_w , curr_ns ) ; curr_sp -> e_cons0 = mm_malloc ( sizeof ( uint8_t ) * MAXSITE ) ; memcpy ( curr_sp -> e_cons0 , e_cons , sizeof ( uint8_t ) * MAXSITE ) ; curr_sp -> score = 1.0 ; curr_sp -> iseq = -1 ; curr_sp -> ioff = -1 ; for ( lett_idx = 0 ; lett_idx < curr_w ; lett_idx ++ ) { curr_sp -> cons0 [ lett_idx ] = ( e_cons ? alph_char ( alph , e_cons [ lett_idx ] ) : alph_wildcard ( alph ) ) ; } curr_sp -> cons0 [ lett_idx ] = ' \0 ' ; } } }
Use the specified consensus string as the EM seed, for all nsites values.
Use the specified consensus string as the EM seed for all nsites values .
// alphabet // The s_point matrix that will be filled up // This seed will be placed at every central s_point // get the number of central widths and nsites // get the central widths // get the central nsites  // only fill the central spoints // get the current central width // get the current central nsites  // get the spoint with width=curr_w nsites=curr_ns // copy the spoint encoded consensus // note that the consensus has been padded with alph_char(alph, 0) // set the score to an abitrary value // set the seq and pos to impossible values // set up human readable consensus sequence cons0 // lett_idx // add the final character to the string // n_idx // w_idx