X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=PairedEndModel.h;h=7c8737465c959da2e3089e39d0fcb091ab3e52ff;hb=0889126d07bc92e2eeec30ee218d8bfa2660dad6;hp=e73c03dd779aec9574a20bcb314c3db0eb1d2975;hpb=1794b68d34625b39404d5aba9e72646805b710ce;p=rsem.git diff --git a/PairedEndModel.h b/PairedEndModel.h index e73c03d..7c87374 100644 --- a/PairedEndModel.h +++ b/PairedEndModel.h @@ -59,11 +59,11 @@ public: mw = NULL; if (isMaster) { - ori = new Orientation(params.probF); if (!estRSPD) rspd = new RSPD(estRSPD); mld = new LenDist(params.mate_minL, params.mate_maxL); } + ori = new Orientation(params.probF); gld = new LenDist(params.minL, params.maxL); if (estRSPD) rspd = new RSPD(estRSPD, params.B); pro = new Profile(params.maxL); @@ -298,15 +298,18 @@ void PairedEndModel::read(const char* inpF) { pro->read(fi); npro->read(fi); - if (fscanf(fi, "%d", &M) == 1) { - mw = new double[M + 1]; - for (int i = 0; i <= M; i++) fscanf(fi, "%lf", &mw[i]); + if (fscanf(fi, "%d", &val) == 1) { + if (M == 0) M = val; + if (M == val) { + mw = new double[M + 1]; + for (int i = 0; i <= M; i++) fscanf(fi, "%lf", &mw[i]); + } } fclose(fi); } -//Only master node can call +//Only master node can call. Only be called at EM.cpp void PairedEndModel::write(const char* outF) { FILE *fo = fopen(outF, "w"); @@ -382,9 +385,8 @@ bool PairedEndModel::simulate(int rid, PairedEndRead& read, int& sid) { readseq2 = pro->simulate(sampler, mateL2, m2pos, m2dir, ref); } - std::ostringstream stdout; - stdout<