diff --git a/CMakeLists.txt b/CMakeLists.txt index 46db406..012b77b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,10 +4,10 @@ enable_testing() project (Sailfish) -set(CPACK_PACKAGE_VERSION "0.7.4") +set(CPACK_PACKAGE_VERSION "0.7.5") set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MINOR "7") -set(CPACK_PACKAGE_VERSION_PATCH "4") +set(CPACK_PACKAGE_VERSION_PATCH "5") set(CPACK_GENERATOR "TGZ") set(CPACK_SOURCE_GENERATOR "TGZ") set(CPACK_PACKAGE_VENDOR "Carnegie Mellon University") diff --git a/include/SailfishConfig.hpp b/include/SailfishConfig.hpp index 6fdd59a..4ddc83d 100644 --- a/include/SailfishConfig.hpp +++ b/include/SailfishConfig.hpp @@ -28,8 +28,8 @@ namespace sailfish { constexpr char majorVersion[] = "0"; constexpr char minorVersion[] = "7"; - constexpr char patchVersion[] = "4"; - constexpr char version[] = "0.7.4"; + constexpr char patchVersion[] = "5"; + constexpr char version[] = "0.7.5"; constexpr uint32_t indexVersion = 1; } diff --git a/src/SailfishQuantify.cpp b/src/SailfishQuantify.cpp index 8d4ff46..df0f48a 100644 --- a/src/SailfishQuantify.cpp +++ b/src/SailfishQuantify.cpp @@ -406,13 +406,15 @@ void quasiMapReads( * (https://github.com/adarob/eXpress/blob/master/src/targets.cpp) * originally written by Adam Roberts. */ + uint32_t minVal = empDist.minValue(); + uint32_t maxVal = empDist.maxValue(); + bool validDistSupport = (maxVal > minVal); double refLen = txp.RefLength; - if (refLen <= empDist.median()) { + if (refLen <= empDist.median() or !validDistSupport) { txp.EffectiveLength = refLen; } else { - uint32_t mval = empDist.maxValue(); double effectiveLength = 0.0; - for (size_t l = empDist.minValue(); l <= std::min(txp.RefLength, mval); ++l) { + for (size_t l = minVal; l <= std::min(txp.RefLength, maxVal); ++l) { effectiveLength += empDist.pdf(l) * (txp.RefLength - l + 1.0); } txp.EffectiveLength = effectiveLength;