
Plot Haplotype Reconstruction Results Before and After HMM
Source:R/plot_reconstructed_haplo.R
plot_reconstructed_haplo.Rd
plot_reconstructed_haplo
visualizes the genotype data before and after HMM-based haplotype reconstruction
for a specified set of individuals. It uses MapRtools::plot_geno()
for visualization
and appends informative titles based on the chromosome name.
Arguments
- original
A genotype matrix before haplotype reconstruction. Rows represent markers, and columns represent individuals.
- processed
A genotype matrix after HMM-based haplotype reconstruction. It must have the same dimensions as
original
.- individuals
A numeric vector specifying the indices of individuals (columns) to plot. Default is
1:50
. All values must be within the column range of the input matrices.
Value
A list with two ggplot objects:
- p1
Genotype plot before HMM, titled with the chromosome name and "Before HMM".
- p2
Genotype plot after HMM, titled with the chromosome name and "After HMM".
Details
The function uses extract_map()
from geneticMapR
to infer the chromosome name from the original
genotype matrix, which is then used to annotate the plots. Both matrices are expected
to be compatible with MapRtools::plot_geno()
.