INNER CODE UNIT · C
rv
dpryan79/MethylDackel · bed.c:31
rv = compareRegions(reg[i].tid, reg[i].start, reg[i].end-1, tid, start, end);
if(rv >= 0) {
*idx = i;
rv = (rv >= 1) ? 0 : 1;
break;
}
}
if(rv < 0) rv = -1;
}
return rv;
}
//-1 if region is before pos (need to go to the next region)
// 0 if pos not in region
//>0 if pos in region
int posOverlapsBED(int32_t tid, int32_t pos, bedRegions *regions, int32_t idx) {
if(idx >= regions->n) return 0; //Past the end of the regions