]> git.donarmstrong.com Git - rsem.git/blobdiff - BamWriter.h
--bowtie-chunkmbs
[rsem.git] / BamWriter.h
index 7f3c562309678389e6f98aae29addce776110939..b39400f5cb9d21c50d2dcdf8ac0222218c5f2286 100644 (file)
@@ -174,6 +174,7 @@ BamWriter::BamWriter(char inpType, const char* inpF, const char* fn_list, const
                }
        }
 
+
        out = samopen(outF, "wb", out_header);
        assert(out != 0);
 
@@ -226,7 +227,7 @@ void BamWriter::work(HitWrapper<SingleHit> wrapper, Transcripts& transcripts) {
 
                        uint16_t rstrand = b->core.flag & 0x0010; // read strand
                        b->core.flag -= rstrand;
-                       rstrand = (!rstrand && transcript.getStrand() == '+' || rstrand && transcript.getStrand() == '-' ? 0 : 0x0010);
+                       rstrand = (((!rstrand && transcript.getStrand() == '+') || (rstrand && transcript.getStrand() == '-')) ? 0 : 0x0010);
                        b->core.flag += rstrand;
 
                        push_qname(qname, b->core.l_qname, data);
@@ -355,7 +356,7 @@ void BamWriter::work(HitWrapper<PairedEndHit> wrapper, Transcripts& transcripts)
                        b2->core.flag = b2->core.flag - (b2->core.flag & 0x0010) - (b2->core.flag & 0x0020);
 
                        uint16_t add, add2;
-                       if (!rstrand && transcript.getStrand() == '+' || rstrand && transcript.getStrand() == '-') {
+                       if ((!rstrand && transcript.getStrand() == '+') || (rstrand && transcript.getStrand() == '-')) {
                                add = 0x0020; add2 = 0x0010;
                        }
                        else {
@@ -478,7 +479,7 @@ void BamWriter::work(HitWrapper<PairedEndHit> wrapper, Transcripts& transcripts)
        bam_destroy1(b);
        bam_destroy1(b2);
 
-       if (verbose) { printf("Bam output file is generated!"); }
+       if (verbose) { printf("Bam output file is generated!\n"); }
 }
 
 void BamWriter::tr2chr(const Transcript& transcript, int sp, int ep, int& pos, int& n_cigar, std::vector<uint8_t>& data) {