]> git.donarmstrong.com Git - rsem.git/blobdiff - PairedEndQModel.h
Allowed > 2^31 hits
[rsem.git] / PairedEndQModel.h
index c61f6c872eaa26be6db47eac88de2c174a1c634f..a2f798120cc2524cae41b7f156aaa4bad524cced 100644 (file)
@@ -8,6 +8,7 @@
 #include<string>
 #include<algorithm>
 #include<sstream>
+#include<iostream>
 
 #include "utils.h"
 #include "my_assert.h"
@@ -197,7 +198,7 @@ public:
        const LenDist& getGLD() { return *gld; }
 
        void startSimulation(simul*, double*);
-       bool simulate(int, PairedEndReadQ&, int&);
+       bool simulate(READ_INT_TYPE, PairedEndReadQ&, int&);
        void finishSimulation();
 
        //Use it after function 'read' or 'estimateFromReads'
@@ -213,7 +214,7 @@ private:
        static const int read_type = 3;
 
        int M;
-       int N[3];
+       READ_INT_TYPE N[3];
        Refs *refs;
        int seedLen;
 
@@ -246,7 +247,7 @@ void PairedEndQModel::estimateFromReads(const char* readFN) {
                genReadFileNames(readFN, i, read_type, s, readFs);
                ReadReader<PairedEndReadQ> reader(s, readFs, refs->hasPolyA(), seedLen); // allow calculation of calc_lq() function
 
-               int cnt = 0;
+               READ_INT_TYPE cnt = 0;
                while (reader.next(read)) {
                        SingleReadQ mate1 = read.getMate1();
                        SingleReadQ mate2 = read.getMate2();
@@ -264,14 +265,14 @@ void PairedEndQModel::estimateFromReads(const char* readFN) {
                                }
                        }
                        else if (verbose && (mate1.getReadLength() < seedLen || mate2.getReadLength() < seedLen)) {
-                               printf("Warning: Read %s is ignored due to at least one of the mates' length < seed length %d!\n", read.getName().c_str(), seedLen);
+                               std::cout<< "Warning: Read "<< read.getName()<< " is ignored due to at least one of the mates' length < 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->finish();
@@ -375,7 +376,7 @@ void PairedEndQModel::startSimulation(simul* sampler, double* theta) {
        nqpro->startSimulation();
 }
 
-bool PairedEndQModel::simulate(int rid, PairedEndReadQ& read, int& sid) {
+bool PairedEndQModel::simulate(READ_INT_TYPE rid, PairedEndReadQ& read, int& sid) {
        int dir, pos;
        int insertL, mateL1, mateL2;
        std::string name;