selectVariants: Auxiliary function to invert minor alleles and to select...

View source: R/locStra.r

selectVariantsR Documentation

Auxiliary function to invert minor alleles and to select those variants/loci exceeding a minimal cutoff value.

Description

Auxiliary function to invert minor alleles and to select those variants/loci exceeding a minimal cutoff value.

Usage

selectVariants(m, phased = FALSE, invertMinorAllele = TRUE, minVariants = 0)

Arguments

m

A (sparse) input matrix. The input matrix is assumed to be oriented to contain the data for one individual per column.

phased

Boolean flag to indicate if the input matrix is phased. Default is phased=FALSE.

invertMinorAllele

Boolean flag to indicate if the minor allele should be inverted. Default is invertMinorAllele=TRUE.

minVariants

Cutoff value for minimal number of variants for keeping a locus. Default is minVariants=0.

Value

The processed matrix with pruned variants/loci.

Examples

require(locStra)
m <- matrix(sample(0:1,100,replace=TRUE),ncol=10)
print(selectVariants(m))


locStra documentation built on April 13, 2022, 1:07 a.m.