]> git.donarmstrong.com Git - rsem.git/blobdiff - EM.cpp
rsem v1.1.11, allow spaces appear in field seqname and attributes gene_id, transcript...
[rsem.git] / EM.cpp
diff --git a/EM.cpp b/EM.cpp
index 08fc8c7d2400396a8fef40fc945717be4b166e83..5f9b8c05a3d11f785eb31de57466e5dd3c4d5e4c 100644 (file)
--- a/EM.cpp
+++ b/EM.cpp
@@ -506,7 +506,7 @@ void EM() {
                        }
 
                if (verbose) printf("ROUND = %d, SUM = %.15g, bChange = %f, totNum = %d\n", ROUND, sum, bChange, totNum);
-       } while (ROUND < MIN_ROUND || totNum > 0 && ROUND < MAX_ROUND);
+       } while (ROUND < MIN_ROUND || (totNum > 0 && ROUND < MAX_ROUND));
          //while (ROUND < MAX_ROUND);
 
        if (totNum > 0) fprintf(stderr, "Warning: RSEM reaches %d iterations before meeting the convergence criteria.\n", MAX_ROUND);
@@ -571,6 +571,7 @@ void EM() {
 
        //calculate expected weights and counts using learned parameters
        updateModel = false; calcExpectedWeights = true;
+       for (int i = 0; i <= M; i++) probv[i] = theta[i];
        for (int i = 0; i < nThreads; i++) {
                rc = pthread_create(&threads[i], &attr, E_STEP<ReadType, HitType, ModelType>, (void*)(&fparams[i]));
                if (rc != 0) { fprintf(stderr, "Cannot create thread %d when calculate expected weights! (numbered from 0)\n", i); exit(-1); }