calc_het: Calculate heterozygosities

Description Usage Arguments Value Examples

View source: R/calc_het.R

Description

Calculate heterozygosites, by individual or by marker

Usage

1
calc_het(probs, by = c("individual", "marker"), omit_x = TRUE, cores = 1)

Arguments

probs

List of arrays of genotype probabilities, as calculated by calc_genoprob().

by

Whether to summarize by individual or marker

omit_x

If TRUE, omit the X chromosome.

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

The result is a vector of estimated heterozygosities

Examples

1
2
3
4
5
6
7
8
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
p <- calc_genoprob(iron, err=0.002)

# heterozygosities by individual
het_ind <- calc_het(p)

# heterozygosities by marker
het_mar <- calc_het(p, "marker")

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