calc_genoprob: Calculate conditional genotype probabilities

Description Usage Arguments Details Value See Also Examples

View source: R/calc_genoprob.R

Description

Uses a hidden Markov model to calculate the probabilities of the true underlying genotypes given the observed multipoint marker data, with possible allowance for genotyping errors.

Usage

1
2
3
4
5
6
7
8
9
calc_genoprob(
  cross,
  map = NULL,
  error_prob = 0.0001,
  map_function = c("haldane", "kosambi", "c-f", "morgan"),
  lowmem = FALSE,
  quiet = TRUE,
  cores = 1
)

Arguments

cross

Object of class "cross2". For details, see the R/qtl2 developer guide.

map

Genetic map of markers. May include pseudomarker locations (that is, locations that are not within the marker genotype data). If NULL, the genetic map in cross is used.

error_prob

Assumed genotyping error probability

map_function

Character string indicating the map function to use to convert genetic distances to recombination fractions.

lowmem

If FALSE, split individuals into groups with common sex and crossinfo and then precalculate the transition matrices for a chromosome; potentially a lot faster but using more memory.

quiet

If FALSE, print progress messages.

cores

Number of CPU cores to use, for parallel calculations. (If 0, use parallel::detectCores().) Alternatively, this can be links to a set of cluster sockets, as produced by parallel::makeCluster().

Details

Let O[k] denote the observed marker genotype at position k, and g[k] denote the corresponding true underlying genotype.

We use the forward-backward equations to calculate a[k][v] = log Pr(O[1], …, O[k], g[k] = v) and b[k][v] = log Pr(O[k+1], …, O[n] | g[k] = v)

We then obtain Pr(g[k] | O[1], …, O[n] = exp(a[k][v] + b[k][v]) / s where s = sum_v exp(a[k][v] + b[k][v])

Value

An object of class "calc_genoprob": a list of three-dimensional arrays of probabilities, individuals x genotypes x positions. (Note that the arrangement is different from R/qtl.) Also contains four attributes:

See Also

insert_pseudomarkers()

Examples

1
2
3
grav2 <- read_cross2(system.file("extdata", "grav2.zip", package="qtl2"))
gmap_w_pmar <- insert_pseudomarkers(grav2$gmap, step=1)
probs <- calc_genoprob(grav2, gmap_w_pmar, error_prob=0.002)

qtl2 documentation built on Oct. 18, 2021, 1:06 a.m.