• Mathieu Giraud's avatar
    core/affectanalyser.cpp: safer p-value estimation, taking into account the central region · 2e23e720
    Mathieu Giraud authored
    As detected by @mikael-s in the parent commit, the region between V and J affectations
    was not taken into account in the p-values, yielding erroneous segmentations
    when this region was very large.
    Now this region is counted *both* for the computation of left and right p-values, solving
    the bug of the parent commit.
    This could be sometimes over-conservative : are we counting things twice ?
    In regular situations, the answer is no, as the p-values
    are eventually computed by getProbabilityAtLeastOrAbove in kmerstore.h,
    that takes into account the length of the seed.
    A more exact option could have been to use something like
    (first_pos_max + last_pos_max / 2) + getS()/2, but it would raise symmetry problems.
    The selected option should anyway improve the estimation in most of the cases.
affectanalyser.cpp 13.2 KB