deps/kb_meme/meme-5.0.1/src/momo-motifx.c
/**
 * Given a matrix, find the row idx and column idx of the minimum value
 * that passes the score and count threshold. If none is found, then
 * row_idx, col_idx, and lowest will not be modified.
 */
Given a matrix, find the row idx and column idx of the minimum value
that passes the score and count threshold. If none is found, then
row_idx, col_idx, and lowest will not be modified.
Given a matrix find the row idx and column idx of the minimum value that passes the score and count threshold . If none is found then row_idx col_idx and lowest will not be modified .
void find_most_significant_within_matrix(MATRIX_T* binomial,
                                         MATRIX_T* phospho_count,
                                         int* row_idx,
                                         int* col_idx,
                                         double* lowest,
                         		 SUMMARY_T* summary,
                                         MOMO_OPTIONS_T* options) {
  int i;
  int j;
  const char* alph_letters = summary->alph_letters;
  for (i = 0; i < get_num_rows(binomial); ++i) {
    for (j = 0; j < get_num_cols(binomial); ++j) {
      double binomial_value = get_matrix_cell(i, j, binomial);
      double count_value = get_matrix_cell(i, j, phospho_count);
      if (i != options->width/2 && !isnan(binomial_value) && !isinf(binomial_value) && binomial_value < log(options->score_threshold) && count_value >= options->min_occurrences) {
        if (binomial_value < *lowest || isnan(*lowest)) {
          *row_idx = i;
          *col_idx = j;
          *lowest = binomial_value;
        }
      }
    }
  }
}
void find_most_significant_within_matrix ( MATRIX_T * binomial , MATRIX_T * phospho_count , int * row_idx , int * col_idx , double * lowest , SUMMARY_T * summary , MOMO_OPTIONS_T * options ) { int i ; int j ; const char * alph_letters = summary -> alph_letters ; for ( i = 0 ; i < get_num_rows ( binomial ) ; ++ i ) { for ( j = 0 ; j < get_num_cols ( binomial ) ; ++ j ) { double binomial_value = get_matrix_cell ( i , j , binomial ) ; double count_value = get_matrix_cell ( i , j , phospho_count ) ; if ( i != options -> width / 2 && ! isnan ( binomial_value ) && ! isinf ( binomial_value ) && binomial_value < log ( options -> score_threshold ) && count_value >= options -> min_occurrences ) { if ( binomial_value < * lowest || isnan ( * lowest ) ) { * row_idx = i ; * col_idx = j ; * lowest = binomial_value ; } } } } }
Given a matrix, find the row idx and column idx of the minimum value
 that passes the score and count threshold.
Given a matrix find the row idx and column idx of the minimum value that passes the score and count threshold .
// 1. value cannot be nan/inf // 2. log(value) < log(options->score_threshold) // 3. value should not be the modified location //if (i != options->width/2 && !isnan(binomial_value) && !isinf(binomial_value) && binomial_value < log(options->score_threshold) && count_value >= options->count_threshold) {