hmmer-3.3/src/p7_spensemble.c
/* link_spsamples():
 * 
 * Defines the rule used for single linkage clustering of sampled
 * domain coordinates. (API is dictated by Easel's general single
 * linkage clustering routine.)
 */


Defines the rule used for single linkage clustering of sampled
domain coordinates. (API is dictated by Easel's general single
linkage clustering routine.)
Defines the rule used for single linkage clustering of sampled domain coordinates . ( API is dictated by Easel ' s general single linkage clustering routine . )
static int
link_spsamples(const void *v1, const void *v2, const void *prm, int *ret_link)
{
  struct p7_spcoord_s   *h1    = (struct p7_spcoord_s *)   v1;
  struct p7_spcoord_s   *h2    = (struct p7_spcoord_s *)   v2;
  struct p7_linkparam_s *param = (struct p7_linkparam_s *) prm;
  int  nov, n;
  int  d1, d2;
  nov = ESL_MIN(h1->j, h2->j) - ESL_MAX(h1->i, h2->i) + 1;      
  n = (param->of_smaller ? ESL_MIN(h1->j - h1->i + 1,  h2->j - h2->i + 1) :     
                           ESL_MAX(h1->j - h1->i + 1,  h2->j - h2->i + 1));      
  if ((float) nov / (float) n  < param->min_overlap) { *ret_link = FALSE; return eslOK; }  
  nov = ESL_MIN(h1->m, h2->m) - ESL_MAX(h1->k, h2->k);
  n   = (param->of_smaller ? ESL_MIN(h1->m - h1->k + 1,  h2->m - h2->k + 1) :
                             ESL_MAX(h1->m - h1->k + 1,  h2->m - h2->k + 1));
  if ((float) nov / (float)  n < param->min_overlap) { *ret_link = FALSE; return eslOK; }
  d1 = (h1->i - h1->k); d2 = (h2->i - h2->k);  if (abs(d1-d2) <= param->max_diagdiff) { *ret_link = TRUE; return eslOK; }	
  d1 = (h1->j - h1->m); d2 = (h2->j - h2->m);  if (abs(d1-d2) <= param->max_diagdiff) { *ret_link = TRUE; return eslOK; }	
  *ret_link = FALSE;
  return eslOK;
}
static int link_spsamples ( const void * v1 , const void * v2 , const void * prm , int * ret_link ) { struct p7_spcoord_s * h1 = ( struct p7_spcoord_s * ) v1 ; struct p7_spcoord_s * h2 = ( struct p7_spcoord_s * ) v2 ; struct p7_linkparam_s * param = ( struct p7_linkparam_s * ) prm ; int nov , n ; int d1 , d2 ; nov = ESL_MIN ( h1 -> j , h2 -> j ) - ESL_MAX ( h1 -> i , h2 -> i ) + 1 ; n = ( param -> of_smaller ? ESL_MIN ( h1 -> j - h1 -> i + 1 , h2 -> j - h2 -> i + 1 ) : ESL_MAX ( h1 -> j - h1 -> i + 1 , h2 -> j - h2 -> i + 1 ) ) ; if ( ( float ) nov / ( float ) n < param -> min_overlap ) { * ret_link = FALSE ; return eslOK ; } nov = ESL_MIN ( h1 -> m , h2 -> m ) - ESL_MAX ( h1 -> k , h2 -> k ) ; n = ( param -> of_smaller ? ESL_MIN ( h1 -> m - h1 -> k + 1 , h2 -> m - h2 -> k + 1 ) : ESL_MAX ( h1 -> m - h1 -> k + 1 , h2 -> m - h2 -> k + 1 ) ) ; if ( ( float ) nov / ( float ) n < param -> min_overlap ) { * ret_link = FALSE ; return eslOK ; } d1 = ( h1 -> i - h1 -> k ) ; d2 = ( h2 -> i - h2 -> k ) ; if ( abs ( d1 - d2 ) <= param -> max_diagdiff ) { * ret_link = TRUE ; return eslOK ; } d1 = ( h1 -> j - h1 -> m ) ; d2 = ( h2 -> j - h2 -> m ) ; if ( abs ( d1 - d2 ) <= param -> max_diagdiff ) { * ret_link = TRUE ; return eslOK ; } * ret_link = FALSE ; return eslOK ; }
link_spsamples():
link_spsamples () :
/* seq overlap test */ /* overlap  */ /* min length of the two hits */ /* max length of the two hits */ /* hmm overlap test */ /* nearby diagonal test */