count_unique_geno: Count the unique genotypes for each row of a genotype matrix

View source: R/count_unique_geno.R

count_unique_genoR Documentation

Count the unique genotypes for each row of a genotype matrix

Description

For genotype data (markers x individuals) on a set of individuals, count the unique genotypes for each marker

Usage

count_unique_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 counts of unique genotypes.

See Also

find_unique_geno()

Examples

g <- rbind(c("NA", "A",  "A",  "A", "T"),
           c("NA", "NA", "NA", "A", "A"),
           c("A",  "A",  "T",  "G", "G"),
           c("C", "C",  "G",  "G", "NA"))
counts <- count_unique_geno(g)

qtl2convert documentation built on July 11, 2022, 5:08 p.m.