Skip to content

Commit

Permalink
Clarify doc
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Sep 20, 2023
1 parent 12e2072 commit ccf971a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions python/tests/beagle.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def convert_to_genetic_map_position(pos):
"""
Convert genomic site positions (bp) to genetic map positions (cM).
In BEAGLE 4.1, when a genetic map is not specified, it is assumed that 1 Mbp = 1cM.
In BEAGLE 4.1, when a genetic map is not specified, it is assumed
that the recombination rate is constant (1 cM / 1 Mb).
This trivial function is meant for documentation.
Expand All @@ -57,7 +58,7 @@ def convert_to_genetic_map_position(pos):
:rtype: numpy.ndarray
"""
assert 0 < np.min(pos), "Site positions are not 1-based or invalid."
return pos / 1e6
return pos / 1e6 # Convert to Mb


def get_weights(genotyped_pos, ungenotyped_pos):
Expand Down
5 changes: 3 additions & 2 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ def convert_to_genetic_map_position(pos):
"""
Convert genomic site positions (bp) to genetic map positions (cM).
In BEAGLE 4.1, when a genetic map is not specified, it is assumed that 1 Mbp = 1cM.
In BEAGLE 4.1, when a genetic map is not specified, it is assumed
that the recombination rate is constant (1 cM / 1 Mb).
This trivial function is meant for documentation.
:param numpy.ndarray pos: Site positions.
:return: Genetic map positions.
:rtype: numpy.ndarray
"""
return pos / 1e6
return pos / 1e6 # Convert to Mb


@njit
Expand Down

0 comments on commit ccf971a

Please sign in to comment.