X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=BamConverter.h;h=037be8953891a38c4ad94ba2d888e114af601351;hb=810375ef69e0de93188c6fa3819cfc584a32ff34;hp=4ea7d3e673e3942e4de7a678acb5be15faf03c11;hpb=a1dc3c6c442d288c7f4218cbb8b7a54f08e9d980;p=rsem.git diff --git a/BamConverter.h b/BamConverter.h index 4ea7d3e..037be89 100644 --- a/BamConverter.h +++ b/BamConverter.h @@ -119,14 +119,13 @@ void BamConverter::process() { // 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; } @@ -227,7 +226,8 @@ inline void BamConverter::writeCollapsedLines() { 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'));