deps/kb_meme/meme-5.0.1/src/starts.c
/**
 * substring_search
 *
 * Perform substring search. For each central width in the sp_matrix, consider
 * every substring of that width from the sequences, as a possible EM seed, and
 * place it in the relevant s_point in the starting point matrix.
 *
  */
substring_search
Perform substring search. For each central width in the sp_matrix, consider
every substring of that width from the sequences, as a possible EM seed, and
place it in the relevant s_point in the starting point matrix.
substring_search Perform substring search . For each central width in the sp_matrix consider every substring of that width from the sequences as a possible EM seed and place it in the relevant s_point in the starting point matrix .
static void substring_search (
  SP_MATRIX *sp_matrix, 
  DATASET *primary, 
  DATASET *control, 
  HASH_TABLE evaluated_seed_ht, 
  MODEL *model 
) {
  int w_idx; 
  int *central_ws = get_central_ws(sp_matrix);
  int n_nsites = sp_get_num_cols(sp_matrix);
  for (w_idx = 0; w_idx < get_num_central_widths(sp_matrix); w_idx++) {
    int curr_w = central_ws[w_idx];
    S_POINT *curr_sp_row = get_sp_arr(sp_matrix, curr_w);
    subseq7(model, primary, control, curr_w, n_nsites, curr_sp_row, evaluated_seed_ht);
    if (PRINT_STARTS) {
      int sp_idx;
      for (sp_idx=0; sp_idx < n_nsites; sp_idx++) { 	
	HEAP *heap = curr_sp_row[sp_idx].seed_heap;
	if (get_num_nodes(heap) > 0) {
	  SEED *best_seed = (SEED *)get_node(heap, get_best_node(heap));
	  printf("w0=%3d, nsites0=%5.0f\n", curr_sp_row[sp_idx].w0, curr_sp_row[sp_idx].nsites0);
	  print_seed(stdout, best_seed);
	}
      } 
    } 
  } 
}
static void substring_search ( SP_MATRIX * sp_matrix , DATASET * primary , DATASET * control , HASH_TABLE evaluated_seed_ht , MODEL * model ) { int w_idx ; int * central_ws = get_central_ws ( sp_matrix ) ; int n_nsites = sp_get_num_cols ( sp_matrix ) ; for ( w_idx = 0 ; w_idx < get_num_central_widths ( sp_matrix ) ; w_idx ++ ) { int curr_w = central_ws [ w_idx ] ; S_POINT * curr_sp_row = get_sp_arr ( sp_matrix , curr_w ) ; subseq7 ( model , primary , control , curr_w , n_nsites , curr_sp_row , evaluated_seed_ht ) ; if ( PRINT_STARTS ) { int sp_idx ; for ( sp_idx = 0 ; sp_idx < n_nsites ; sp_idx ++ ) { HEAP * heap = curr_sp_row [ sp_idx ] . seed_heap ; if ( get_num_nodes ( heap ) > 0 ) { SEED * best_seed = ( SEED * ) get_node ( heap , get_best_node ( heap ) ) ; printf ( " \n " , curr_sp_row [ sp_idx ] . w0 , curr_sp_row [ sp_idx ] . nsites0 ) ; print_seed ( stdout , best_seed ) ; } } } } }
substring_search
 Perform substring search.
substring_search Perform substring search .
// Matrix of spoints each with different n and w values // Primary sequences  // Control sequences // A hash table for recording novel seeds // The motif model (nascent) /* For each central width in the sp_matrix, perform substring search on the
     appropriate S_POINT array. Finish on curr_w == max_w: */ // The index of the current "central" width. // Get the row from the matrix that has the current width: // Perform substring search under the current width: // set up human readable consensus sequence for starting point // best seed // Retrieve the best seed, from the heap: // Only print sites for the s_point if its heap was non-empty: // best seed // print // w_idx