count_xo: Count numbers of crossovers

Description Usage Arguments Value See Also Examples

View source: R/count_xo.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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 Oct. 18, 2021, 1:06 a.m.