Commit 67f28a89 authored by Mathieu Giraud's avatar Mathieu Giraud

core/kmerstore.h: getProbabilityAtLeastOrAbove(at_least = 0) always returns 1.0

With the previous changes, one may have e-value computations on short sequences,
leading to a possibly negative number of k-mers in getProbabilityAtLeastOrAbove().

Fixes #2107.
parent cd701d9f
......@@ -364,6 +364,8 @@ int IKmerStore<T>::atMostMaxSizeIndexing(int n) const {
template<class T>
double IKmerStore<T>::getProbabilityAtLeastOrAbove(const T kmer, int at_least, int length) const {
if (at_least == 0) return 1.0; // even if 'length' is very small
// n: number of kmers in the sequence
int n = length - getS() + 1;
float index_load = getIndexLoad(kmer) ;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment