X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=BamWriter.h;h=b39400f5cb9d21c50d2dcdf8ac0222218c5f2286;hb=791b978145b0d22865ee350db9d58072bb99d816;hp=7f3c562309678389e6f98aae29addce776110939;hpb=a95154919f950f86de9104b2b9dcf1f0c7e83387;p=rsem.git diff --git a/BamWriter.h b/BamWriter.h index 7f3c562..b39400f 100644 --- a/BamWriter.h +++ b/BamWriter.h @@ -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 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 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 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& data) {