genotypes.pyRAD.loci: Generates genotypes from a 'subset.pyRAD.loci' object

View source: R/genotypes.pyRAD.loci.R

genotypes.pyRAD.lociR Documentation

Generates genotypes from a subset.pyRAD.loci object

Description

Makes a dataframe of SNP calls from a pyRAD.loci object for export to hierfstat

Usage

genotypes.pyRAD.loci(dat, groups, loci = 'all', taxa = 'all',
	        useSnps = c('first', 'all'), concat = c(FALSE, TRUE),
					use.tidyName = FALSE,
					na.rm = c('none', 'columns', 'rows'),
					maxAlleles = 2,
					tidyVals = c('-', '.','>', '_', ' '),
					sortByGroups = TRUE,
					variable.only = FALSE, make.dummy.column = TRUE,
					alleleDigits = 1,
					toInteger = TRUE, missingData = "00",
					cores = 1)

Arguments

dat

an object of class subset.pyRAD.loci

groups

a list of vectors, each vector designating a set of individuals to count for each group

loci

a character vector of loci to include; defaults to all loci

taxa

a character vector of taxa to include; defaults to all taxa

useSnps

whether to use the first SNP in each locus or all

concat

boolean: whether to concatenate SNPs or return by locus

use.tidyName

choose whether or not to use tidyName when matching names

na.rm

whether to remove missin data by columns, by rows, or not at all

maxAlleles

maximum number of alleles per locus

tidyVals

characters to be stripped out by tidyName, if using

sortByGroups

boolean: whether to sort snps by groups

variable.only

boolean: whether to keep only variable sites

make.dummy.column

boolean: whether to add a dummy column when there is only one SNP (currently added as a work-around for wc)

alleleDigits

how many digits per allele

toInteger

boolean: whether to return SNPs as integers

missingData

string to use for missing data

cores

how many processing cores to use; if cores = 1, lapply is used throughout instead of mclapply

Details

current not tightly integrated with hierfstat, but designed to be used by it

Value

data.frame of genotypes

Author(s)

Andrew Hipp

See Also

subset.pyRAD.loci


andrew-hipp/RADami documentation built on Nov. 9, 2023, 5:40 p.m.