deps/kb_meme/meme-5.0.1/src/momo-modl.c
/**
 * Returns if the sequence contains the regexmotif. Returns false if regexmotif is null.
 */
Returns if the sequence contains the regexmotif. Returns false if regexmotif is null.
Returns if the sequence contains the regexmotif . Returns false if regexmotif is null .
bool sequence_contains_regexmotif(REGEX_MOTIF_T* regexmotif,
                                       char* sequence,
                                       MOMO_OPTIONS_T* options,
                                       SUMMARY_T* summary) {
  if (regexmotif == NULL) {
    return false;
  }
  int i;
  int width_no_center = options->width - 1;
  const char* alph_letters = summary->alph_letters;
  for (i = 0; i < width_no_center; ++i) {
    if (regexmotif->conserved[i]) {
      int char_idx = (i < width_no_center / 2) ? i : i+1;
      char* alph_letters_substring = strchr(alph_letters, sequence[char_idx]);
      if (alph_letters_substring) {
        int aa_idx = alph_letters_substring - alph_letters;
        if (get_matrix_cell(i, aa_idx, regexmotif->residues) != 1.0) {
          return false;
        }
      } else {
        return false;
      }
    }
  }
  return true;
}
bool sequence_contains_regexmotif ( REGEX_MOTIF_T * regexmotif , char * sequence , MOMO_OPTIONS_T * options , SUMMARY_T * summary ) { if ( regexmotif == NULL ) { return false ; } int i ; int width_no_center = options -> width - 1 ; const char * alph_letters = summary -> alph_letters ; for ( i = 0 ; i < width_no_center ; ++ i ) { if ( regexmotif -> conserved [ i ] ) { int char_idx = ( i < width_no_center / 2 ) ? i : i + 1 ; char * alph_letters_substring = strchr ( alph_letters , sequence [ char_idx ] ) ; if ( alph_letters_substring ) { int aa_idx = alph_letters_substring - alph_letters ; if ( get_matrix_cell ( i , aa_idx , regexmotif -> residues ) != 1.0 ) { return false ; } } else { return false ; } } } return true ; }
Returns if the sequence contains the regexmotif.
Returns if the sequence contains the regexmotif .