deps/kb_meme/meme-5.0.1/src/spamo.c
/**************************************************************************
 * Determines if a motif has a result set so similar that it should be
 * declared redundant.
 **************************************************************************/
Determines if a motif has a result set so similar that it should be
declared redundant.
Determines if a motif has a result set so similar that it should be declared redundant .
int is_redundant(SPAMO_OPTIONS_T *options, SECONDARY_MOTIF_T *best, SECONDARY_MOTIF_T *other) {
  int same, overlap, i;
  double joint;
  if (best->sigs == NULL || other->sigs == NULL) return false;
  if (best->seq_count == 0 || other->seq_count == 0) return false;
  int orient_best = best->sigs->orient;
  int orient_other = other->sigs->orient;
  if (!(
        (LEFT_SIDE(orient_best) && LEFT_SIDE(orient_other)) || 
        (RIGHT_SIDE(orient_best) && RIGHT_SIDE(orient_other))
      )) return false; 
  overlap = peak_overlap(options->bin, best, other);
  if (overlap < options->overlap) return false;
  same = set_intersect_count(best->seqs, best->seq_count, other->seqs, other->seq_count);
  if (best->seq_count < other->seq_count) {
    joint = (double)same / best->seq_count;
  } else {
    joint = (double)same / other->seq_count;
  }
  return joint > options->joint;
}
int is_redundant ( SPAMO_OPTIONS_T * options , SECONDARY_MOTIF_T * best , SECONDARY_MOTIF_T * other ) { int same , overlap , i ; double joint ; if ( best -> sigs == NULL || other -> sigs == NULL ) return false ; if ( best -> seq_count == 0 || other -> seq_count == 0 ) return false ; int orient_best = best -> sigs -> orient ; int orient_other = other -> sigs -> orient ; if ( ! ( ( LEFT_SIDE ( orient_best ) && LEFT_SIDE ( orient_other ) ) || ( RIGHT_SIDE ( orient_best ) && RIGHT_SIDE ( orient_other ) ) ) ) return false ; overlap = peak_overlap ( options -> bin , best , other ) ; if ( overlap < options -> overlap ) return false ; same = set_intersect_count ( best -> seqs , best -> seq_count , other -> seqs , other -> seq_count ) ; if ( best -> seq_count < other -> seq_count ) { joint = ( double ) same / best -> seq_count ; } else { joint = ( double ) same / other -> seq_count ; } return joint > options -> joint ; }
Determines if a motif has a result set so similar that it should be
 declared redundant.
Determines if a motif has a result set so similar that it should be declared redundant .
// Return if either motif has no significant spacing // Return if either has seq_count set to zero. // calculate the overlap // check that they're on the same side //different side //check that the overlap is large enough //check that the sequence set is similar enough