예제 #1
0
static inline int heap_lt(const heap1_t a, const heap1_t b)
{
	if (g_is_by_qname) {
		int t;
		if (a.b == 0 || b.b == 0) return a.b == 0? 1 : 0;
		t = strnum_cmp(bam1_qname(a.b), bam1_qname(b.b));
		return (t > 0 || (t == 0 && __pos_cmp(a, b)));
	} else return __pos_cmp(a, b);
}
예제 #2
0
static inline int heap_lt(const heap1_t a, const heap1_t b)
{
	if (g_is_by_qname) {
                int t;
                if (a.b == 0 || b.b == 0) return a.b == 0? 1 : 0;
                t = strnum_cmp(bam1_qname(a.b), bam1_qname(b.b));
                if (t != 0) return (0 > t);
                if(1 == (a.b->core.flag&BAM_FPAIRED) && 1 == (b.b->core.flag&BAM_FPAIRED)) {
                    if(a.b->core.flag&BAM_FREAD1) return (0 < 1);
                    else return (1 < 0);
                }
                else return __pos_cmp(a, b);
	} else return __pos_cmp(a, b);
}
예제 #3
0
// Function to compare reads in the heap and determine which one is < the other
static inline int heap_lt(const heap1_t a, const heap1_t b)
{
    if (g_is_by_qname) {
        int t;
        if (a.b == NULL || b.b == NULL) return a.b == NULL? 1 : 0;
        t = strnum_cmp(bam_get_qname(a.b), bam_get_qname(b.b));
        return (t > 0 || (t == 0 && (a.b->core.flag&0xc0) > (b.b->core.flag&0xc0)));
    } else return __pos_cmp(a, b);
}