View source: R/interp_genoprob.R
interp_genoprob | R Documentation |
Linear interpolation of genotype probabilities, mostly to get two sets onto the same map for comparison purposes.
interp_genoprob(probs, map, cores = 1)
probs |
Genotype probabilities, as calculated from
|
map |
List of vectors of map positions. |
cores |
Number of CPU cores to use, for parallel calculations.
(If |
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.
An object of class "calc_genoprob"
, like the input,
but with additional positions present in map
. See calc_genoprob()
.
calc_genoprob()
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.