maxmarg {qtl2} | R Documentation |
Find genotypes with maximum marginal probabilities
Description
For each individual at each position, find the genotype with the maximum marginal probability.
Usage
maxmarg(
probs,
map = NULL,
minprob = 0.95,
chr = NULL,
pos = NULL,
return_char = FALSE,
quiet = TRUE,
cores = 1,
tol = 0.0000000000001
)
Arguments
probs |
Genotype probabilities, as calculated from
|
map |
Map of pseudomarkers in |
minprob |
Minimum probability for making a call. If maximum
probability is less then this value, give |
chr |
If provided (along with |
pos |
If provided (along with |
return_char |
If TRUE, return genotype names as character strings. |
quiet |
IF |
cores |
Number of CPU cores to use, for parallel calculations.
(If |
tol |
Tolerance value; genotypes with probability that are within
|
Details
If multiple genotypes share the maximum probability, one is chosen at random.
Value
If chr
and pos
are provided, a vector of
genotypes is returned. In this case, map
is needed.
Otherwise, the result is a object like that returned by viterbi()
,
A list of two-dimensional arrays of imputed genotypes,
individuals x positions. Also includes these attributes:
-
crosstype
- The cross type of the inputcross
. -
is_x_chr
- Logical vector indicating whether chromosomes are to be treated as the X chromosome or not, from inputcross
. -
alleles
- Vector of allele codes, from inputcross
.
See Also
Examples
# load data and calculate genotype probabilities
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
pr <- calc_genoprob(iron, error_prob=0.002)
# full set of imputed genotypes
ginf <- maxmarg(pr)
# imputed genotypes at a fixed position
g <- maxmarg(pr, iron$gmap, chr=8, pos=45.5)
# return genotype names rather than integers
g <- maxmarg(pr, iron$gmap, chr=8, pos=45.5, return_char=TRUE)