X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=SingleModel.h;h=7ad3464180def871d224023326c2a6992bbbaa74;hp=8b26e0e36dd4e919eb5635d2504617a9c7b841ca;hb=9eef8b58056b7cdaad1b4bdb2b2904d9fc0ff430;hpb=f67ec16ff8add74c17df026f77cf39e5a1aca051 diff --git a/SingleModel.h b/SingleModel.h index 8b26e0e..7ad3464 100644 --- a/SingleModel.h +++ b/SingleModel.h @@ -8,6 +8,7 @@ #include #include #include +#include #include "utils.h" #include "my_assert.h" @@ -230,7 +231,7 @@ public: const LenDist& getGLD() { return *gld; } void startSimulation(simul*, double*); - bool simulate(int, SingleRead&, int&); + bool simulate(READ_INT_TYPE, SingleRead&, int&); void finishSimulation(); double* getMW() { @@ -245,7 +246,7 @@ private: static const int read_type = 0; int M; - int N[3]; + READ_INT_TYPE N[3]; Refs *refs; double mean, sd; int seedLen; @@ -279,21 +280,21 @@ void SingleModel::estimateFromReads(const char* readFN) { genReadFileNames(readFN, i, read_type, s, readFs); ReadReader reader(s, readFs, refs->hasPolyA(), seedLen); // allow calculation of calc_lq() function - int cnt = 0; + READ_INT_TYPE cnt = 0; while (reader.next(read)) { if (!read.isLowQuality()) { mld != NULL ? mld->update(read.getReadLength(), 1.0) : gld->update(read.getReadLength(), 1.0); if (i == 0) { npro->updateC(read.getReadSeq()); } } else if (verbose && read.getReadLength() < seedLen) { - printf("Warning: Read %s is ignored due to read length %d < seed length %d!\n", read.getName().c_str(), read.getReadLength(), seedLen); + std::cout<< "Warning: Read "<< read.getName()<< " is ignored due to read length "<< read.getReadLength()<< " < seed length "<< seedLen<< "!"<< std::endl; } - + ++cnt; - if (verbose && cnt % 1000000 == 0) { printf("%d READS PROCESSED\n", cnt); } + if (verbose && cnt % 1000000 == 0) { std::cout<< cnt<< " READS PROCESSED"<< std::endl; } } - if (verbose) { printf("estimateFromReads, N%d finished.\n", i); } + if (verbose) { std::cout<< "estimateFromReads, N"<< i<< " finished."<< std::endl; } } mld != NULL ? mld->finish() : gld->finish(); @@ -403,7 +404,7 @@ void SingleModel::startSimulation(simul* sampler, double* theta) { npro->startSimulation(); } -bool SingleModel::simulate(int rid, SingleRead& read, int& sid) { +bool SingleModel::simulate(READ_INT_TYPE rid, SingleRead& read, int& sid) { int dir, pos, readLen, fragLen; std::string name; std::string readseq;