Skip to content

Commit

Permalink
Raise precision
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Jan 21, 2024
1 parent 8f2aa1c commit fa282fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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]]
Expand Down

0 comments on commit fa282fa

Please sign in to comment.