-
Notifications
You must be signed in to change notification settings - Fork 52
Description
clever solution that immensely speeds up the expected_cis calculation is to do fast Fourier convolution for calculation of pairwise distances between bad bins (here). However, at least with latest scipy version 1.8.1, there is a rarely encountered problem that fftconvolve produces NaNs for all of the output (it is not stochastic, but happens for some shapes of bad bins vectors). Because we explicitly convert nans to integers, they become negative very large numbers. (noticed by @kannandeepti )
I do not know what might be a problem with fftconvolve, but maybe we can pass an option to calculate regular convolution?
E.g. this scipy.signal.convolve(x, x[::-1], mode="full", method="direct")
will produce no error if used instead of:
cooltools/cooltools/api/expected.py
Line 57 in ab5d775
return np.round(fftconvolve(x, x[::-1], mode="full")).astype(int)[-n:] |