plot_compare_haplotypes | R Documentation |
This function plots two sets of haplotypes for comparison, allowing for visual inspection of homologous allele patterns across two groups or conditions. It is designed to handle and display genetic data for organisms with varying ploidy levels.
plot_compare_haplotypes(
ploidy,
hom.allele.p1,
hom.allele.q1,
hom.allele.p2 = NULL,
hom.allele.q2 = NULL
)
ploidy |
Integer, specifying the ploidy level of the organism being represented. |
hom.allele.p1 |
A list where each element represents the alleles for a marker in the first haplotype group, for 'p' parent. |
hom.allele.q1 |
A list where each element represents the alleles for a marker in the first haplotype group, for 'q' parent. |
hom.allele.p2 |
Optionally, a list where each element represents the alleles for a marker in the second haplotype group, for 'p' parent. |
hom.allele.q2 |
Optionally, a list where each element represents the alleles for a marker in the second haplotype group, for 'q' parent. |
The function creates a graphical representation of haplotypes, where each marker's alleles are plotted along a line for each parent ('p' and 'q'). If provided, the second set of haplotypes (for comparison) are overlaid on the same plot. This allows for direct visual comparison of allele presence or absence across the two sets. Different colors are used to distinguish between the first and second sets of haplotypes.
The function uses several internal helper functions ('ph_list_to_matrix' and 'ph_matrix_to_list') to manipulate haplotype data. These functions should correctly handle the conversion between list and matrix representations of haplotype data.
Invisible. The function primarily generates a plot for visual analysis and does not return any data.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.