@@ -46,7 +46,7 @@ def convert_to_genetic_map_position(pos):
4646 """
4747 Convert genomic site positions (bp) to genetic map positions (cM).
4848
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.
5050
5151 This trivial function is meant for documentation.
5252
@@ -144,7 +144,7 @@ def get_switch_prob(pos, h, ne=1e6):
144144
145145def compute_forward_probability_matrix (ref_h , query_h , rho , mu ):
146146 """
147- Implement the forwards algorithm.
147+ Implement the forward algorithm.
148148
149149 The forward probablity matrix is of size (m, h),
150150 where m is the number of genotyped markers
@@ -176,8 +176,10 @@ def compute_forward_probability_matrix(ref_h, query_h, rho, mu):
176176 # Get site-specific parameters
177177 shift = rho [i ] / h
178178 scale = (1 - rho [i ]) / last_sum
179+ # Get allele at genotyped marker i on query haplotype j
179180 query_a = query_h [i ]
180181 for j in np .arange (h ):
182+ # Get allele at genotyped marker i on reference haplotype j
181183 ref_a = ref_h [i , j ]
182184 # Get emission probability
183185 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):
192194
193195def compute_backward_probability_matrix (ref_h , query_h , rho , mu ):
194196 """
195- Implement the backwards algorithm.
197+ Implement the backward algorithm.
196198
197199 The backward probablity matrix is of size (m, h),
198200 where m is the number of genotyped markers
@@ -203,7 +205,7 @@ def compute_backward_probability_matrix(ref_h, query_h, rho, mu):
203205
204206 `query_h` is also subsetted to genotyped markers (length m).
205207
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.
207209 Here, we keep the values at all the sites.
208210
209211 :param numpy.ndarray ref_h: Reference haplotypes.
0 commit comments