Estimating the parameters in the model for the Fixed Ploidy Variant Detection tool

The Fixed Ploidy Variant Detection tool uses the Expectation Maximization (EM) procedure for estimating the unknown parameters in the model, that is, the prior site type probabilities, $ f_s, s \in S$ and the error rates $ \{e(N \rightarrow M) \vert N,M \in \{A, C, G, T, -\}\}$. The EM procedure is an iterative procedure: it starts with a set of initial prior site type frequencies, $ f_s^0, s \in S$ and a set of initial error probabilities, $ \{e^0_q(N \rightarrow M) \vert N,M \in \{A, C, G, T, -\}\}$. It then iteratively updates first the prior site type frequencies (to get $ f_s^1, s \in S$), then the error probabilities (to get $ \{e^1_q(N \rightarrow M) \vert N,M \in \{A, C, G, T, -\}\}$), then the site type frequencies again, etc. (a total of four rounds), in such a manner that the observed nucleotide patterns at the sites in the alignment become increasingly likely. To give an example of the forces at play in this iteration: as you increase the error rates you will decrease the likelihood of observing 'clean' patterns (e.g. patterns of only $ A$s and $ C$s at site types $ A/C$) and increase the likelihood of observing 'noisy' patterns (e.g. patterns of other than only $ A$s, and $ C$ at site types $ A/C$). If, on the other hand, you decrease the error rates, you will increase the likelihood of observing 'clean' patterns and decrease the likelihood of observing 'noisy' patterns. The EM procedure ensures that the balance between these two is optimized relative to the data observed (assuming, of course, that the ploidy assumption is valid).