View source: R/plot_progeny_dosage_change.R
| plot_progeny_dosage_change | R Documentation |
Computes genotype probabilities under a global genotyping error rate, derives homolog probabilities, compares the most likely HMM-implied dosages to the original dosage matrix, and plots which entries were unchanged, imputed (originally missing), or changed.
plot_progeny_dosage_change(
map_list,
error,
verbose = TRUE,
output_corrected = FALSE
)
map_list |
A non-empty list of objects of class |
error |
Numeric scalar. Global genotyping error rate passed to
|
verbose |
Logical. If |
output_corrected |
Logical. If |
Missing dosages in dat$geno.dose are assumed to be encoded as
ploidy + 1. The function prints a heatmap-style ggplot2 tile
plot and, optionally, returns a corrected dosage matrix with marker metadata.
The mappoly.data object is retrieved by name from
map_list[[1]]$info$data.name. The function:
Runs calc_genoprob_error() for each map in map_list.
Computes homolog probabilities with calc_homologprob().
For each marker and individual, selects the ploidy most likely
homologs and converts them to a dosage implied by the phased map.
Compares implied dosages to dat$geno.dose and summarizes the
fraction of entries that were imputed (original missing) vs changed.
Produces a tile plot showing unchanged/imputed/changed cells.
If output_corrected = FALSE, returns invisible(NULL) and
prints a ggplot. If output_corrected = TRUE, returns a matrix
with columns P1, P2, sequence, sequence_position,
followed by one column per individual containing corrected dosages.
Jeekin Lau, with optimization by Cristiane Taniguti
calc_genoprob_error,
calc_homologprob
## Not run:
x <- get_submap(solcap.err.map[[1]], 1:5, reestimate.rf = FALSE)
corrected_matrix <- plot_progeny_dosage_change(list(x), error = 0.05,
output_corrected = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.