count_xo: Count numbers of crossovers

View source: R/count_xo.R

count_xoR Documentation

Count numbers of crossovers

Description

Estimate the numbers of crossovers in each individual on each chromosome.

Usage

count_xo(geno, quiet = TRUE, cores = 1)

Arguments

geno

List of matrices of genotypes (output of maxmarg() or viterbi()) or a list of 3d-arrays of genotypes (output of sim_geno()).

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().

Value

A matrix of crossover counts, individuals x chromosomes, or (if the input was the output of sim_geno()) a 3d-array of crossover counts, individuals x chromosomes x imputations.

See Also

locate_xo()

Examples

iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))

map <- insert_pseudomarkers(iron$gmap, step=1)
pr <- calc_genoprob(iron, map, error_prob=0.002, map_function="c-f")
g <- maxmarg(pr)
n_xo <- count_xo(g)

# imputations
imp <- sim_geno(iron, map, error_prob=0.002, map_function="c-f", n_draws=32)
n_xo_imp <- count_xo(imp)
# sums across chromosomes
tot_xo_imp <- apply(n_xo_imp, c(1,3), sum)
# mean and SD across imputations
summary_xo <- cbind(mean=rowMeans(tot_xo_imp),
                    sd=apply(tot_xo_imp, 1, sd))


qtl2 documentation built on May 29, 2024, 11:46 a.m.