]> git.donarmstrong.com Git - rsem.git/blobdiff - BamConverter.h
Updated boost to v1.55.0
[rsem.git] / BamConverter.h
index 4ea7d3e673e3942e4de7a678acb5be15faf03c11..037be8953891a38c4ad94ba2d888e114af601351 100644 (file)
@@ -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'));