Skip to content

Commit

Permalink
Memoize calls to calc_overlap_pvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Jan 3, 2025
1 parent ecb81c3 commit 0f95ed7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions micall/utils/overlap_stitcher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from fractions import Fraction
from typing import Sequence, Iterator, Tuple
from operator import itemgetter
from functools import lru_cache
from gotoh import align_it
import math

Expand Down Expand Up @@ -87,6 +88,7 @@ def sort_concordance_indexes(concordance: Sequence[Fraction]) -> Iterator[int]:
yield i


@lru_cache
def calc_overlap_pvalue(L: int, M: int) -> Fraction:
"""
Compute the probability (p-value) of observing at least M matches
Expand Down

0 comments on commit 0f95ed7

Please sign in to comment.