deps/kb_meme/meme-5.0.1/src/momo-motifx.c
/**
 * Remove sequences do not match a pattern from phospho and bg lists and update their respective count matrix
 */
Remove sequences do not match a pattern from phospho and bg lists and update their respective count matrix
Remove sequences do not match a pattern from phospho and bg lists and update their respective count matrix
void remove_sequences_and_update_matrix(char letter,
                                        int pos,
                                        ARRAYLST_T* seqs,
                                        MOTIFX_STATUS_T** status_array,
                                        int* num_active,
                                        MATRIX_T* count,
                                        SUMMARY_T* summary,
                                        MOMO_OPTIONS_T* options) {
  int i;
  const char* alph_letters = summary->alph_letters;
  for (i = 0; i < arraylst_size(seqs); ++i) {
    char* curr_seq = get_raw_sequence((SEQ_T*) (options->eliminate_repeat_width ? hash_get_entry_value((HASH_TABLE_ENTRY*) arraylst_get(i, seqs)) : arraylst_get(i, seqs)));
    MOTIFX_STATUS_T status = (*status_array)[i];
    if (status == ACTIVE && curr_seq[pos] != letter) {
      *num_active = *num_active - 1;
      (*status_array)[i] = INACTIVE;
    }
  }
  count = get_count_matrix(count, seqs, status_array, options, summary);
}
void remove_sequences_and_update_matrix ( char letter , int pos , ARRAYLST_T * seqs , MOTIFX_STATUS_T * * status_array , int * num_active , MATRIX_T * count , SUMMARY_T * summary , MOMO_OPTIONS_T * options ) { int i ; const char * alph_letters = summary -> alph_letters ; for ( i = 0 ; i < arraylst_size ( seqs ) ; ++ i ) { char * curr_seq = get_raw_sequence ( ( SEQ_T * ) ( options -> eliminate_repeat_width ? hash_get_entry_value ( ( HASH_TABLE_ENTRY * ) arraylst_get ( i , seqs ) ) : arraylst_get ( i , seqs ) ) ) ; MOTIFX_STATUS_T status = ( * status_array ) [ i ] ; if ( status == ACTIVE && curr_seq [ pos ] != letter ) { * num_active = * num_active - 1 ; ( * status_array ) [ i ] = INACTIVE ; } } count = get_count_matrix ( count , seqs , status_array , options , summary ) ; }
Remove sequences do not match a pattern from phospho and bg lists and update their respective count matrix
Remove sequences do not match a pattern from phospho and bg lists and update their respective count matrix
// Look through phospho_seqs and remove sequences. Update phospho_seqs // For anything active that does not match the pattern, turn it inactive.