find_consensus_geno: Find the consensus genotype for each row of a genotype matrix

Description Usage Arguments Value See Also Examples

View source: R/find_consensus_geno.R

Description

For genotype data (markers x individuals) on a set of individuals from a single inbred line, find the consensus genotype at each marker.

Usage

1
find_consensus_geno(genotypes, na.strings = c("N", "H", "NA", ""), cores = 1)

Arguments

genotypes

Matrix of genotypes (markers x individuals)

na.strings

Genotypes to be considered as missing values.

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

Vector of consensus genotypes, one value per row of genotypes

See Also

find_unique_geno(), encode_geno()

Examples

1
2
3
4
5
g <- rbind(c("NA", "N", "A", "A", "T", "G", NA, "H"),
           c("C",  "C", "G", "G", "A", NA,  NA, NA),
           rep(NA, 8),
           c("C", "C", "G", "G", "G", "C", "G", "G"))
consensus <- find_consensus_geno(g)

qtl2convert documentation built on Oct. 7, 2021, 9:27 a.m.