FSFHap stage 3: 5-state Viterbi-training EM imputation (imputeUsingViterbiFiveState)
Source:R/RcppExports.R
fsfhap_impute_five_state_cpp.RdThe real FSFHap imputation step (via ViterbiAlgorithmPlugin). Faithful port
of imputeUsingViterbiFiveState: per-taxon 5-state Viterbi on non-missing
parent calls with a distance-scaled transition, EM re-estimating emission +
transition from state-count matrices until the emission-count matrix stabilizes.
Arguments
- G
Integer matrix, taxa x sites, parent-called
gin{0 A-hom, 1 het, 2 C-hom, 3 missing}(stage-1b output); one family, one chromosome, sorted.- pos
Integer marker positions (bp), length = ncol(G).
- phet
Design-derived expected heterozygosity (
(1-F)/2); sets the initial state distribution{phom, .25 phet, .5 phet, .25 phet, phom}.- max_iter
EM iteration cap (TASSEL 50).