X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=PairedEndReadQ.h;h=751382074b9816134f90cde692507031f598f3fd;hp=36b703b059ed4bd4fad7a3eb873c216f49f22e19;hb=refs%2Fheads%2Fupstream;hpb=946f9a6adb2a82048c8453d44693cd3838d32939 diff --git a/PairedEndReadQ.h b/PairedEndReadQ.h index 36b703b..7513820 100644 --- a/PairedEndReadQ.h +++ b/PairedEndReadQ.h @@ -15,8 +15,6 @@ public: this->mate1 = mate1; this->mate2 = mate2; this->name = mate1.getName(); - - calc_lq(); } bool read(int argc, std::istream* argv[], int flags = 7); @@ -29,10 +27,10 @@ public: else return mate2; } + void calc_lq(bool, int); // calculate if this read is low quality. Without calling this function, isLowQuality() will always be false + private: SingleReadQ mate1, mate2; - - void calc_lq(); }; bool PairedEndReadQ::read(int argc, std::istream* argv[], int flags) { @@ -45,8 +43,6 @@ bool PairedEndReadQ::read(int argc, std::istream* argv[], int flags) { name = ""; if (flags & 4) { name = mate1.getName(); } //May chop 1 char later if we want - if (flags & 1) calc_lq(); - return success; } @@ -59,9 +55,13 @@ void PairedEndReadQ::write(int argc, std::ostream* argv[]) { mate2.write(1, outMate2); } -void PairedEndReadQ::calc_lq() { - low_quality = mate1.isLowQuality() && mate2.isLowQuality(); - if (mate1.getReadLength() < OLEN || mate2.getReadLength() < OLEN) low_quality = true; +//calculate if this read is low quality +void PairedEndReadQ::calc_lq(bool hasPolyA, int seedLen) { + low_quality = false; + mate1.calc_lq(hasPolyA, seedLen); + mate2.calc_lq(hasPolyA, seedLen); + if (mate1.getReadLength() < seedLen || mate2.getReadLength() < seedLen) low_quality = true; + else low_quality = mate1.isLowQuality() && mate2.isLowQuality(); } #endif /* PAIREDENDREADQ_H_ */