maxmarg | R Documentation |
For each individual at each position, find the genotype with the maximum marginal probability.
maxmarg(
probs,
map = NULL,
minprob = 0.95,
chr = NULL,
pos = NULL,
return_char = FALSE,
quiet = TRUE,
cores = 1,
tol = 0.0000000000001
)
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
|
If multiple genotypes share the maximum probability, one is chosen at random.
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 input cross
.
is_x_chr
- Logical vector indicating whether chromosomes
are to be treated as the X chromosome or not, from input cross
.
alleles
- Vector of allele codes, from input
cross
.
sim_geno()
, viterbi()
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.