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

View source: R/find_consensus_geno.R

find_consensus_genoR Documentation

Find the consensus genotype for each row of a genotype matrix

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

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

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 July 11, 2022, 5:08 p.m.