Closed eveilyeverafter closed 9 years ago
The error traced back to the estimate_anc_fwd_back() function. In some cases there is a tie where the posterior probability of belonging to either ancestral allele is equal (0.5). I fixed this by randomly picking one of the states using the sample() function. There are other ways to go about this fix. For example, I could have called the state with the highest posterior probability on either side but that would create additional computation time and would start getting into problems if there were long regions along the chromosome that are equally likely to come from either parent (e.g., in extremely low coverage scenarios).
Example: