find_unique_geno {qtl2convert} | R Documentation |
Find the unique genotypes for each row of a genotype matrix
Description
For genotype data (markers x individuals) on a set of individuals, find the unique genotypes for each marker, provided that there are exactly two. (If more than two or fewer than two, return NAs.)
Usage
find_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 |
Value
Matrix with two columns. Each row corresponds to a marker,
and has the two unique genotypes, or NA
s (if >2 or <2 unique
genotypes).
See Also
count_unique_geno()
, encode_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"))
ug <- find_unique_geno(g)
[Package qtl2convert version 0.30 Index]