X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=LenDist.h;h=90d47d74522cbc90088ff8267b387046a533a0e3;hb=810375ef69e0de93188c6fa3819cfc584a32ff34;hp=f19babaa1bf79079f22c2fae4e3ce86926f6ea63;hpb=7b8405a9fe481d041d7e50d1d8abb4b589bdc0d3;p=rsem.git diff --git a/LenDist.h b/LenDist.h index f19baba..90d47d7 100644 --- a/LenDist.h +++ b/LenDist.h @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -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];