diff --git a/include/SalmonConfig.hpp b/include/SalmonConfig.hpp index c7348b4..6df38d9 100644 --- a/include/SalmonConfig.hpp +++ b/include/SalmonConfig.hpp @@ -28,8 +28,8 @@ namespace salmon { constexpr char majorVersion[] = "0"; constexpr char minorVersion[] = "2"; - constexpr char patchVersion[] = "3"; - constexpr char version[] = "0.2.3"; + constexpr char patchVersion[] = "5"; + constexpr char version[] = "0.2.5"; } #endif // SALMON_CONFIG_HPP diff --git a/include/Sampler.hpp b/include/Sampler.hpp index 1a4800b..a6894ae 100644 --- a/include/Sampler.hpp +++ b/include/Sampler.hpp @@ -158,16 +158,14 @@ namespace salmon { double logFragProb = sailfish::math::LOG_1; if (!salmonOpts.noFragLengthDist) { - switch (aln->fragType()) { - case ReadType::SINGLE_END: - if (aln->isLeft() and transcript.RefLength - aln->left() < fragLengthDist.maxVal()) { - logFragProb = fragLengthDist.cmf(transcript.RefLength - aln->left()); - } else if (aln->isRight() and aln->right() < fragLengthDist.maxVal()) { - logFragProb = fragLengthDist.cmf(aln->right()); - } - break; - case ReadType::PAIRED_END: - logFragProb = fragLengthDist.pmf(static_cast(aln->fragLen())); + if(aln->fragLen() == 0) { + if (aln->isLeft() and transcript.RefLength - aln->left() < fragLengthDist.maxVal()) { + logFragProb = fragLengthDist.cmf(transcript.RefLength - aln->left()); + } else if (aln->isRight() and aln->right() < fragLengthDist.maxVal()) { + logFragProb = fragLengthDist.cmf(aln->right()); + } + } else { + logFragProb = fragLengthDist.pmf(static_cast(aln->fragLen())); } } @@ -214,6 +212,7 @@ namespace salmon { double massInc{0.0}; bool choseAlignment{false}; for (auto& aln : alnGroup->alignments()) { + if (aln->logProb == LOG_0) { continue; } aln->logProb -= sumOfAlignProbs; massInc = std::exp(aln->logProb); diff --git a/src/SalmonQuantifyAlignments.cpp b/src/SalmonQuantifyAlignments.cpp index e8b6ed8..94ea9cf 100644 --- a/src/SalmonQuantifyAlignments.cpp +++ b/src/SalmonQuantifyAlignments.cpp @@ -236,6 +236,7 @@ void processMiniBatch(AlignmentLibrary& alnLib, // Normalize the scores for (auto& aln : alnGroup->alignments()) { + if (aln->logProb == LOG_0) { continue; } aln->logProb -= sumOfAlignProbs; double r = uni(eng);