deps/kb_meme/meme-5.0.1/src/tomtom.c
/**************************************************************************
 * Computes BLiC scores for all pairs of positions in two motifs.
 **************************************************************************/
Computes BLiC scores for all pairs of positions in two motifs.
Computes BLiC scores for all pairs of positions in two motifs .
static void blic_scores(
    int num_dirichlets,     
    MOTIF_T* query_motif,   
    MOTIF_T* target_motif,  
    ARRAY_T* background,    
    int offset,
    MATRIX_T** scores)      
{
  int query_i;
  for (query_i = 0; query_i < get_motif_length(query_motif); query_i++) {
    ARRAY_T* query_counts = get_motif_counts(query_i, query_motif);
    int target_i;
    for (target_i = 0; target_i < get_motif_length(target_motif); target_i++) {
      ARRAY_T* target_counts = get_motif_counts(target_i, target_motif);
      double my_score 
        = one_blic_score(
            num_dirichlets,
            query_counts,
            target_counts,
            background
            );
      free_array(target_counts);
      set_matrix_cell(query_i, offset + target_i, my_score, *scores);
    }
    free_array(query_counts);
  }
}
static void blic_scores ( int num_dirichlets , MOTIF_T * query_motif , MOTIF_T * target_motif , ARRAY_T * background , int offset , MATRIX_T * * scores ) { int query_i ; for ( query_i = 0 ; query_i < get_motif_length ( query_motif ) ; query_i ++ ) { ARRAY_T * query_counts = get_motif_counts ( query_i , query_motif ) ; int target_i ; for ( target_i = 0 ; target_i < get_motif_length ( target_motif ) ; target_i ++ ) { ARRAY_T * target_counts = get_motif_counts ( target_i , target_motif ) ; double my_score = one_blic_score ( num_dirichlets , query_counts , target_counts , background ) ; free_array ( target_counts ) ; set_matrix_cell ( query_i , offset + target_i , my_score , * scores ) ; } free_array ( query_counts ) ; } }
Computes BLiC scores for all pairs of positions in two motifs.
Computes BLiC scores for all pairs of positions in two motifs .
// Number of Dirichlets [IN] // Single query motif [IN]. // Single target motif [IN]. // Background distribution [IN]. // BLiC score matrix, indexed by start. [OUT] // Traverse the query and target motifs // Compute the BLiC score according to Equation (2). // Store the computed score.