@@ -46,7 +46,7 @@ def convert_to_genetic_map_position(pos):
46
46
"""
47
47
Convert genomic site positions (bp) to genetic map positions (cM).
48
48
49
- When a genetic map is not specified, it is assumed that 1 Mbp = 1cM.
49
+ In BEAGLE 4.1, when a genetic map is not specified, it is assumed that 1 Mbp = 1cM.
50
50
51
51
This trivial function is meant for documentation.
52
52
@@ -144,7 +144,7 @@ def get_switch_prob(pos, h, ne=1e6):
144
144
145
145
def compute_forward_probability_matrix (ref_h , query_h , rho , mu ):
146
146
"""
147
- Implement the forwards algorithm.
147
+ Implement the forward algorithm.
148
148
149
149
The forward probablity matrix is of size (m, h),
150
150
where m is the number of genotyped markers
@@ -176,8 +176,10 @@ def compute_forward_probability_matrix(ref_h, query_h, rho, mu):
176
176
# Get site-specific parameters
177
177
shift = rho [i ] / h
178
178
scale = (1 - rho [i ]) / last_sum
179
+ # Get allele at genotyped marker i on query haplotype j
179
180
query_a = query_h [i ]
180
181
for j in np .arange (h ):
182
+ # Get allele at genotyped marker i on reference haplotype j
181
183
ref_a = ref_h [i , j ]
182
184
# Get emission probability
183
185
em_prob = mu [i ] if query_a != ref_a else 1.0 - mu [i ]
@@ -192,7 +194,7 @@ def compute_forward_probability_matrix(ref_h, query_h, rho, mu):
192
194
193
195
def compute_backward_probability_matrix (ref_h , query_h , rho , mu ):
194
196
"""
195
- Implement the backwards algorithm.
197
+ Implement the backward algorithm.
196
198
197
199
The backward probablity matrix is of size (m, h),
198
200
where m is the number of genotyped markers
@@ -203,7 +205,7 @@ def compute_backward_probability_matrix(ref_h, query_h, rho, mu):
203
205
204
206
`query_h` is also subsetted to genotyped markers (length m).
205
207
206
- In BEAGLE, the values are kept one site at a time.
208
+ In BEAGLE 4.1 , the values are kept one site at a time.
207
209
Here, we keep the values at all the sites.
208
210
209
211
:param numpy.ndarray ref_h: Reference haplotypes.
0 commit comments