Skip to content

Commit 47b8ccd

Browse files
committed
Fix doc
1 parent c689d52 commit 47b8ccd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

python/tests/test_beagle.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,20 @@ def get_switch_prob(pos, h, ne=1e6):
119119
"""
120120
Set switch probabilities at genotyped markers.
121121
122+
Note that in BEAGLE, the default value of `ne` is set to 1e6.
123+
If `h` is small and `ne` is large, the switch probability is nearly 1.
124+
In such cases, it may be desirable to set `ne` to a small value
125+
to avoid switching between haplotypes all the time.
126+
122127
:param numpy.ndarray pos: Site positions.
123-
:param numpy.ndarray h: Number of reference haplotypes.
128+
:param int h: Number of reference haplotypes.
124129
:param float ne: Effective population size.
125130
:return: Switch probabilities.
126131
:rtype: numpy.ndarray
127132
"""
128133
assert pos[0] > 0, "Site positions are not 1-based."
134+
assert isinstance(h, int), "Number of reference haplotypes is not an integer."
135+
assert isinstance(ne, float), "Effective population size is not a float."
129136
# Get genetic distance between adjacent markers.
130137
cm = np.concatenate([[0], convert_to_genetic_map_position(pos)])
131138
gen_dist = cm[1:] - cm[:-1]

0 commit comments

Comments
 (0)