X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=BamConverter.h;h=e7253ba9415b566442f3efbfe266ffe052bb2753;hb=cb94fd597b180aa7cb01ae84c9d1025201b98d8e;hp=9b543087443aac68a72999a13e874b199d613cc4;hpb=5fd66ada6c610981dcecd50e5e41436e0458b110;p=rsem.git diff --git a/BamConverter.h b/BamConverter.h index 9b54308..e7253ba 100644 --- a/BamConverter.h +++ b/BamConverter.h @@ -14,6 +14,7 @@ #include "sam_rsem_cvt.h" #include "utils.h" +#include "my_assert.h" #include "bc_aux.h" #include "Transcript.h" #include "Transcripts.h" @@ -44,8 +45,7 @@ private: BamConverter::BamConverter(const char* inpF, const char* outF, const char* chr_list, Transcripts& transcripts) : transcripts(transcripts) { - if (transcripts.getType() != 0) - exitWithError("Genome information is not provided! RSEM cannot convert the transcript bam file!"); + general_assert(transcripts.getType() == 0, "Genome information is not provided! RSEM cannot convert the transcript bam file!"); in = samopen(inpF, "rb", NULL); assert(in != 0); @@ -91,7 +91,7 @@ void BamConverter::process() { if (cnt % 1000000 == 0) { printf("."); fflush(stdout); } // at least one segment is not properly mapped - if ((b->core.flag & 0x0004) || isPaired && (b2->core.flag & 0x0004)) continue; + if ((b->core.flag & 0x0004) || (isPaired && (b2->core.flag & 0x0004))) continue; const Transcript& transcript = transcripts.getTranscriptAt(b->core.tid + 1); @@ -123,7 +123,7 @@ void BamConverter::convert(bam1_t* b, const Transcript& transcript) { int pos = b->core.pos; int readlen = b->core.l_qseq; - if (readlen == 0) exitWithError("One alignment line has SEQ field as *. RSEM does not support this currently!"); + general_assert(readlen > 0, "One alignment line has SEQ field as *. RSEM does not support this currently!"); iter = refmap.find(transcript.getSeqName()); assert(iter != refmap.end());