deps/kb_meme/meme-5.0.1/src/momo-motifx.c
/**
 * Creates and stores a motifs using the motif-x
 * algorithm for a given mod until no more are left.
 */
Creates and stores a motifs using the motif-x
algorithm for a given mod until no more are left.
Creates and stores a motifs using the motif - x algorithm for a given mod until no more are left .
void create_motifx_motifs(SUMMARY_T* summary,
                          MOMO_OPTIONS_T* options,
                          MOD_INFO_T * mod_info,
                          SEQ_T** all_sequences,
                          int num_sequences) {
  int i;
  ARRAYLST_T* phospho_seqs = mod_info->seq_list;
  ARRAYLST_T* bg_seqs = mod_info->bg_seq_list;
  MOTIFX_STATUS_T* phospho_status = init_status_array(arraylst_size(phospho_seqs));
  MOTIFX_STATUS_T* bg_status = init_status_array(arraylst_size(bg_seqs));
  int* num_active = mm_malloc(sizeof(int));
  int* num_bg_active = mm_malloc(sizeof(int));
  *num_active = arraylst_size(phospho_seqs);
  *num_bg_active = arraylst_size(bg_seqs);
  MATRIX_T* phospho_count = NULL;
  MATRIX_T* bg_count = NULL;
  phospho_count = get_count_matrix(phospho_count, phospho_seqs, NULL, options, summary);
  bg_count = get_count_matrix(bg_count, bg_seqs, NULL, options, summary);
  create_motifx_motif(phospho_seqs,
                      bg_seqs,
                      &phospho_status,
                      &bg_status,
                      phospho_count,
                      bg_count,
                      num_active,
                      num_bg_active,
                      mod_info->mod_name,
                      mod_info,
                      options,
                      summary);
  myfree(num_active);
  myfree(num_bg_active);
  myfree(phospho_status);
  myfree(bg_status);
  free_matrix(phospho_count);
  free_matrix(bg_count);
}
void create_motifx_motifs ( SUMMARY_T * summary , MOMO_OPTIONS_T * options , MOD_INFO_T * mod_info , SEQ_T * * all_sequences , int num_sequences ) { int i ; ARRAYLST_T * phospho_seqs = mod_info -> seq_list ; ARRAYLST_T * bg_seqs = mod_info -> bg_seq_list ; MOTIFX_STATUS_T * phospho_status = init_status_array ( arraylst_size ( phospho_seqs ) ) ; MOTIFX_STATUS_T * bg_status = init_status_array ( arraylst_size ( bg_seqs ) ) ; int * num_active = mm_malloc ( sizeof ( int ) ) ; int * num_bg_active = mm_malloc ( sizeof ( int ) ) ; * num_active = arraylst_size ( phospho_seqs ) ; * num_bg_active = arraylst_size ( bg_seqs ) ; MATRIX_T * phospho_count = NULL ; MATRIX_T * bg_count = NULL ; phospho_count = get_count_matrix ( phospho_count , phospho_seqs , NULL , options , summary ) ; bg_count = get_count_matrix ( bg_count , bg_seqs , NULL , options , summary ) ; create_motifx_motif ( phospho_seqs , bg_seqs , & phospho_status , & bg_status , phospho_count , bg_count , num_active , num_bg_active , mod_info -> mod_name , mod_info , options , summary ) ; myfree ( num_active ) ; myfree ( num_bg_active ) ; myfree ( phospho_status ) ; myfree ( bg_status ) ; free_matrix ( phospho_count ) ; free_matrix ( bg_count ) ; }
Creates and stores a motifs using the motif-x
 algorithm for a given mod until no more are left.
Creates and stores a motifs using the motif - x algorithm for a given mod until no more are left .
// Initialize status // Initialize sequence counter. This contains the number of ACTIVE sequences in status // Initialize count matrices // Recursively create motifs // Clean up