interp_genoprob: Interpolate genotype probabilities

Description Usage Arguments Details Value See Also Examples

Description

Linear interpolation of genotype probabilities, mostly to get two sets onto the same map for comparison purposes.

Usage

1
interp_genoprob(probs, map, cores = 1)

Arguments

probs

Genotype probabilities, as calculated from calc_genoprob().

map

List of vectors of map positions.

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

We reduce probs to the positions present in map and then interpolate the genotype probabilities at additional positions in map by linear interpolation using the two adjacent positions. Off the ends, we just copy over the first or last value unchanged.

In general, it's better to use insert_pseudomarkers() and calc_genoprob() to get genotype probabilities at additional positions along a chromosome. This function is a very crude alternative that was implemented in order to compare genotype probabilities derived by different methods, where we first need to get them onto a common set of positions.

Value

An object like the input probs but with additional positions present in map.

See Also

calc_genoprob()

Examples

1
2
3
4
5
6
7
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2geno"))

probs <- calc_genoprob(iron, iron$gmap, error_prob=0.002)

# you generally wouldn't want to do this, but this is an illustration
map <- insert_pseudomarkers(iron$gmap, step=1)
probs_map <- interp_genoprob(probs, map)

rqtl/qtl2geno documentation built on May 28, 2019, 2:36 a.m.