compute_het: Heterozygosity

Description Usage Arguments Value Examples

View source: R/heterozygosity.R

Description

compute_het returns results from heterozygosity check

Usage

1
2
compute_het(x, output = c("marker_names", "marker_heterozygosity"),
  het_threshold = 0, na_coding = "??")

Arguments

x

A matrix. Genotype names are stored in rows whereas marker names are stored in columns. No missing values are allowed.

output

Character vector with output options.

het_threshold

Numeric or complex vector specifying the heterozygosity threshold.

na_coding

Scalar providing the encoding of missing elements.

Value

If output is "marker_names" a character vector with marker names that have passed the quality check will be returned. If output is "marker_heterozygosity" a numeric vector with the heterozygosity at each marker locus will be returned.

Examples

1
2
3
4
5
6
7
8
 # Load a matrix with SNP genotypes encoded as numeric values
 data(imp_snps)

 # Return the names of all markers with a heterozygosity of less than 10%.
 compute_het(imp_snps, output = "marker_names", het_threshold = 0.1)

 # Return the heterozygosity at each locus.
 compute_het(imp_snps, output = "marker_heterozygosity", het_threshold = 0)

mwesthues/sspredr documentation built on May 23, 2019, 10:56 a.m.