]> git.donarmstrong.com Git - rsem.git/blobdiff - LenDist.h
For genome BAM, modified MD tag accordingly
[rsem.git] / LenDist.h
index f19babaa1bf79079f22c2fae4e3ce86926f6ea63..90d47d74522cbc90088ff8267b387046a533a0e3 100644 (file)
--- a/LenDist.h
+++ b/LenDist.h
@@ -3,6 +3,7 @@
 
 #include<cstdio>
 #include<cstring>
+#include<cstdlib>
 #include<cassert>
 #include<algorithm>
 
@@ -189,6 +190,8 @@ void LenDist::finish() {
                sum += pdf[i];
        }
 
+       if (sum <= EPSILON) { fprintf(stderr, "No valid read to estimate the length distribution!\n"); exit(-1); }
+
        for (int i = 1; i <= span; i++) {
                pdf[i] = pdf[i] / sum;
                cdf[i] = cdf[i - 1] + pdf[i];