guess_phase {qtl2} | R Documentation |
Guess phase of imputed genotypes
Description
Turn imputed genotypes into phased genotypes along chromosomes by attempting to pick the phase that leads to the fewest recombination events.
Usage
guess_phase(cross, geno, deterministic = FALSE, cores = 1)
Arguments
cross |
Object of class |
geno |
Imputed genotypes, as a list of matrices, as from |
deterministic |
If TRUE, preferentially put smaller allele first when there's uncertainty. If FALSE, the order of alleles is random in such cases. |
cores |
Number of CPU cores to use, for parallel calculations.
(If |
Details
We randomly assign the pair of alleles at the first locus to two haplotypes, and then work left to right, assigning alleles to haplotypes one locus at a time seeking the fewest recombination events. The results are subject to arbitrary and random choices. For example, to the right of a homozygous region, either orientation is equally reasonable.
Value
If input cross is phase-known (e.g., recombinant inbred lines),
the output will be the input geno
. Otherwise, the output
will be a list of three-dimensional arrays of imputed
genotypes, individual x position x haplotype (1/2).
See Also
Examples
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
gmap <- insert_pseudomarkers(iron$gmap, step=1)
probs <- calc_genoprob(iron, gmap, error_prob=0.002)
imp_geno <- maxmarg(probs)
ph_geno <- guess_phase(iron, imp_geno)