deps/kb_meme/meme-5.0.1/src/tomtom.c
/**************************************************************************
 * Computes the score for a particular configuration
 **************************************************************************/
Computes the score for a particular configuration
Computes the score for a particular configuration
static double compute_overlap_score(
    MATRIX_T* scores, int query_len, int target_len, int target_offset,
    int configuration, int *index_start, int *index_stop) {
  int target_col, query_col;
  double score;
  if (configuration <= query_len) {
    target_col = 0;
    query_col = query_len - configuration;
  } else {
    query_col = 0;
    target_col = configuration - query_len;
  }
  score = 0;
  *index_start = query_col;
  do {
    score += get_matrix_cell(query_col, target_offset + target_col, scores);
    query_col++; target_col++;
  } while ((query_col < query_len) && (target_col < target_len));
  *index_stop = query_col - 1; 
  return score;
}
static double compute_overlap_score ( MATRIX_T * scores , int query_len , int target_len , int target_offset , int configuration , int * index_start , int * index_stop ) { int target_col , query_col ; double score ; if ( configuration <= query_len ) { target_col = 0 ; query_col = query_len - configuration ; } else { query_col = 0 ; target_col = configuration - query_len ; } score = 0 ; * index_start = query_col ; do { score += get_matrix_cell ( query_col , target_offset + target_col , scores ) ; query_col ++ ; target_col ++ ; } while ( ( query_col < query_len ) && ( target_col < target_len ) ) ; * index_stop = query_col - 1 ; return score ; }
Computes the score for a particular configuration
Computes the score for a particular configuration
// Initialize the columns from where the comparison needs to be started // Sum the pairwise column scores. // -1 for the last increment