deps/kb_meme/meme-5.0.1/src/spamo.c
/**************************************************************************
 * Calculate the maximum overlap of the two best peaks
 **************************************************************************/
Calculate the maximum overlap of the two best peaks
Calculate the maximum overlap of the two best peaks
static inline int peak_overlap(int bin_size, SECONDARY_MOTIF_T *smot1, SECONDARY_MOTIF_T *smot2) {
  int mot1_closest, mot1_furthest, mot2_closest, mot2_furthest, overlap;
  mot1_closest = smot1->sigs->bin * bin_size + 1;
  mot1_furthest = (smot1->sigs->bin + 1) * bin_size + get_motif_trimmed_length(smot1->motif) - 1;
  mot2_closest = smot2->sigs->bin * bin_size + 1;
  mot2_furthest = (smot2->sigs->bin + 1) * bin_size + get_motif_trimmed_length(smot2->motif) - 1;
  if (mot1_furthest < mot2_closest) return false; 
  if (mot2_furthest < mot1_closest) return false; 
  if (mot1_closest < mot2_closest) {
    overlap = mot1_furthest - mot2_closest + 1;
  } else {
    overlap = mot2_furthest - mot1_closest + 1;
  }
  return overlap;
}
static inline int peak_overlap ( int bin_size , SECONDARY_MOTIF_T * smot1 , SECONDARY_MOTIF_T * smot2 ) { int mot1_closest , mot1_furthest , mot2_closest , mot2_furthest , overlap ; mot1_closest = smot1 -> sigs -> bin * bin_size + 1 ; mot1_furthest = ( smot1 -> sigs -> bin + 1 ) * bin_size + get_motif_trimmed_length ( smot1 -> motif ) - 1 ; mot2_closest = smot2 -> sigs -> bin * bin_size + 1 ; mot2_furthest = ( smot2 -> sigs -> bin + 1 ) * bin_size + get_motif_trimmed_length ( smot2 -> motif ) - 1 ; if ( mot1_furthest < mot2_closest ) return false ; if ( mot2_furthest < mot1_closest ) return false ; if ( mot1_closest < mot2_closest ) { overlap = mot1_furthest - mot2_closest + 1 ; } else { overlap = mot2_furthest - mot1_closest + 1 ; } return overlap ; }
Calculate the maximum overlap of the two best peaks
Calculate the maximum overlap of the two best peaks
// Get distances (closest/furthest) of each of the two secondary motifs from primary motif. //check for overlap //no overlap //no overlap