Skip to main content
Fig. 3 | BMC Bioinformatics

Fig. 3

From: Variable-order sequence modeling improves bacterial strain discrimination for Ion Torrent DNA reads

Fig. 3

a The Viterbi equations, extended for the higher order paired HMMs. In addition to the X c and Y c counts, a higher order HMM is also restricted by its order which we term n order (see Fig. 2 for definition of other variables). The order used to calculate \(p_{x^{n}_{i}y^{n}_{j}}\), \(q_{x^{n}_{i}}\), \(q_{y^{n}_{j}}\) is then taken as the minimum between the X c ,Y c counts and n order as shown above. b Update of count matrices, where \(x^{*}_{c}\) and \(y^{*}_{c}\) are the x c and y c values we from the Viterbi path we take in the (a) equations (see text for details) c The order used and the X c and Y c values updated at each alignment position for a 2nd order paired HMM (using Fig. 2 example). The order used at each position is based on the X c and Y c counts from the previous position and the equations in (a). For example when A aligns to A at V M(3,4), the previous alignment position was at (2,3) in state X, and so the order used to calculate V M(3,4) is the minimum of [\(\mathbf {X}^{\mathrm {X}}_{\mathrm {c}}(2,3)\), \(\mathbf {Y}^{\mathrm {X}}_{\mathrm {c}}(2,3)\), n order ], which is equal to zero as \(\mathbf {Y}^{\mathrm {X}}_{\mathrm {c}}(2,3)=0\)

Back to article page