// at least one segment is not properly mapped
bool notgood = (b->core.flag & 0x0004) || (isPaired && (b2->core.flag & 0x0004));
-
- if (isPaired && notgood) assert((b->core.flag & 0x0004) && (b2->core.flag & 0x0004));
-
+ if (isPaired && notgood) general_assert((b->core.flag & 0x0004) && (b2->core.flag & 0x0004), cstrtos(bam1_qname(b)) + "'s two mates are not all marked as unalignable!");
if (!notgood) {
// for collapsing
if (isPaired) {
assert(b->core.tid == b2->core.tid);
+ general_assert(b->core.tid == b2->core.tid, cstrtos(bam1_qname(b)) + "'s two mates are aligned to two different transcripts!");
if ((b->core.flag & 0x0080) && (b2->core.flag & 0x0040)) {
bam1_t *tmp = b; b = b2; b2 = tmp;
}
memcpy(bam_aux_get(tmp_b, "ZW") + 1, (uint8_t*)&(prb), bam_aux_type2size('f'));
tmp_b->core.qual = getMAPQ(prb);
}
- else tmp_b->core.qual = getMAPQ(1.0);
+ // otherwise, just use the MAPQ score of the orignal alignment
+
samwrite(out, tmp_b);
if (isPaired) {
if (p != NULL) memcpy(bam_aux_get(tmp_b2, "ZW") + 1, (uint8_t*)&(prb), bam_aux_type2size('f'));