]> git.donarmstrong.com Git - rsem.git/commitdiff
Fixed a bug which will lead to out-of-memory error when RSEM computes ngvector for...
authorBo Li <bli@cs.wisc.edu>
Sat, 1 Feb 2014 00:03:52 +0000 (18:03 -0600)
committerBo Li <bli@cs.wisc.edu>
Sat, 1 Feb 2014 00:03:52 +0000 (18:03 -0600)
EBSeq/calcClusteringInfo.cpp
WHAT_IS_NEW

index c1d64bb29c1c6be80068d718bc6a12508d917509..27357b23f757298bc2e3a3794318ee5a5e432cb4 100644 (file)
 #include<algorithm>
 using namespace std;
 
 #include<algorithm>
 using namespace std;
 
-typedef unsigned int INTEGER;
-
 const int STRLEN = 1005;
 
 const int STRLEN = 1005;
 
-INTEGER M;
+int M;
 int k; // k-mer size
 vector<string> names;
 vector<string> seqs;
 int k; // k-mer size
 vector<string> names;
 vector<string> seqs;
-vector<INTEGER> effL;
+vector<int> effL;
 
 // tid starts from 1
 struct ReadType {
 
 // tid starts from 1
 struct ReadType {
-  INTEGER tid, pos;
+  int tid, pos;
 
 
-  ReadType(INTEGER tid, INTEGER pos) {
+  ReadType(int tid, int pos) {
     this->tid = tid;
     this->pos = pos;
   }
     this->tid = tid;
     this->pos = pos;
   }
@@ -104,10 +102,10 @@ int main(int argc, char* argv[]) {
 
   cands.clear();
   effL.assign(M + 1, 0);
 
   cands.clear();
   effL.assign(M + 1, 0);
-  for (INTEGER i = 1; i <= M; i++) {
-    effL[i] = seqs[i].length() - k + 1;
+  for (int i = 1; i <= M; i++) {
+    effL[i] = int(seqs[i].length()) - k + 1;
     if (effL[i] <= 0) effL[i] = 0; // effL should be non-negative
     if (effL[i] <= 0) effL[i] = 0; // effL should be non-negative
-    for (INTEGER j = 0; j < effL[i]; j++) 
+    for (int j = 0; j < effL[i]; j++) 
       cands.push_back(ReadType(i, j));
   }
   printf("All possbile %d mers are generated.\n", k);
       cands.push_back(ReadType(i, j));
   }
   printf("All possbile %d mers are generated.\n", k);
@@ -133,7 +131,7 @@ int main(int argc, char* argv[]) {
       p = i;
     }
 
       p = i;
     }
 
-  for (INTEGER i = 1; i <= M; i++) 
+  for (int i = 1; i <= M; i++) 
     if (effL[i] == 0) clusteringInfo[i] = -1.0;
     else clusteringInfo[i] /= effL[i];
 
     if (effL[i] == 0) clusteringInfo[i] = -1.0;
     else clusteringInfo[i] /= effL[i];
 
@@ -141,7 +139,7 @@ int main(int argc, char* argv[]) {
 
 
   ofstream fout(argv[3]);
 
 
   ofstream fout(argv[3]);
-  for (INTEGER i = 1; i <= M; i++) fout<<names[i]<<"\t"<<setprecision(6)<<clusteringInfo[i]<<endl;
+  for (int i = 1; i <= M; i++) fout<<names[i]<<"\t"<<setprecision(6)<<clusteringInfo[i]<<endl;
   fout.close();
 
   return 0;
   fout.close();
 
   return 0;
index 30d927063a3610926219a01c7431e335a41f08a6..77f966d1f8fe4b35ab31d40ffda78ccdd941741b 100644 (file)
@@ -1,3 +1,9 @@
+RSEM v1.2.10
+
+- Fixed a bug which will lead to out-of-memory error when RSEM computes ngvector for EBSeq
+
+--------------------------------------------------------------------------------------------
+
 RSEM v1.2.9
 
 - Fixed a compilation error problem in Mac OS
 RSEM v1.2.9
 
 - Fixed a compilation error problem in Mac OS