filter.var: Filter (query) genotype by variation Functon to test that a...

View source: R/runtess.R

filter.varR Documentation

Filter (query) genotype by variation Functon to test that a column of the genotypic matrix is a snp. Using default values for min.freqs this function tests if a site is a SNP. This function is used internally in several other functions.

Description

Filter (query) genotype by variation

Functon to test that a column of the genotypic matrix is a snp. Using default values for min.freqs this function tests if a site is a SNP. This function is used internally in several other functions.

Usage

filter.var(alignment.site, min.freqs = c(2, 1, 0, 0))

Arguments

alignment.site

Character vector containing alleles for each individual at a site.

min.freqs

Numerical vector with minimum frequency of the most common allele, minimum frequency of the second most common allele, ect.. The length of this vector determines how many individuals must have non-missing data.

Value

TRUE if site meets criteria specified by min.freqs, otherwise false.

Examples

library(misc.wrappers)

# Path to VCF with SNPs
vcf.path    <- file.path(system.file("extdata", package = "misc.wrappers"), "simK4.vcf.gz")
# Path to file with longitude and latitude of sampling locality of each individual
coords.path <- file.path(system.file("extdata", package = "misc.wrappers"), "simK4_coords.txt")
# Run tess3r 30 times each for K=1-10
runtess(x=vcf.path,coords=coords.path,kmax=10,reps=30,save.as="tess3r_simK4.pdf")

JeffWeinell/misc.wrappers documentation built on Sept. 20, 2023, 12:42 p.m.