From fa282fadc88a81a578bc4077de944c385b045308 Mon Sep 17 00:00:00 2001 From: Shing Zhan Date: Sun, 21 Jan 2024 16:41:24 +0000 Subject: [PATCH] Raise precision --- python/tests/beagle_numba.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/tests/beagle_numba.py b/python/tests/beagle_numba.py index 0f767dc21e..008ef815b2 100644 --- a/python/tests/beagle_numba.py +++ b/python/tests/beagle_numba.py @@ -66,8 +66,6 @@ def convert_to_genetic_map_positions(pos, genetic_map=None): needs to contain physical positions and corresponding genetic map positions. See `PlinkGenMap.java` in the BEAGLE 4.1 source code for details. - TODO: Check against implementation in scikit-allel. - :param numpy.ndarray pos: Physical positions (bp). :param GeneticMap genetic_map: Genetic map. :return: Genetic map positions (cM). @@ -81,7 +79,7 @@ def convert_to_genetic_map_positions(pos, genetic_map=None): # Approximate genetic map distances by linear interpolation. # Note np.searchsorted(a, v, side='right') returns i s.t. a[i-1] <= v < a[i]. right_idx = np.searchsorted(genetic_map.base_pos, pos, side="right") - est_cm = np.zeros(len(pos), dtype=np.float32) + est_cm = np.zeros(len(pos), dtype=np.float64) # BEAGLE 4.1 uses double in Java. for i in range(len(pos)): a = genetic_map.base_pos[right_idx[i] - 1] b = genetic_map.base_pos[right_idx[i]]