Skip to contents

This function generates necessary genotype count formats for BayEnv and BayPass with a subset of SNPs

Usage

gt.format(
  gt,
  info,
  format = c("benv", "bpass"),
  snp.subset = NULL,
  parallel = FALSE
)

Arguments

gt

multi-vector. an imported data.frame of genotypes or genotype data frame generated by hetTgen or path to GT.FORMAT file generated from VCFTools

info

a data frame containing sample and population information. It must have “sample” and “population” columns

format

character. output format i.e., for BayPass or BayEnv

snp.subset

numerical. number of randomly selected subsets of SNPs. default = NULL

parallel

logical. whether to parallelize the process

Value

Returns a list with formatted genotype data: $bayenv - snps in horizontal format - for BayEnv (two lines per snp); $baypass - vertical format - for BayPass (two column per snp); $sub.bp - subsets snps for BayPass $sub.be - subsets of snps for BayEnv

Author

Piyal Karunarathne

Examples

if (FALSE) vcf.file.path <- paste0(path.package("rCNV"), "/example.raw.vcf.gz")
vcf <- readVCF(vcf.file.path=vcf.file.path)
#> Error in eval(expr, envir, enclos): object 'vcf.file.path' not found
het.table<-hetTgen(vcf,"GT")
#> Error in eval(expr, envir, enclos): object 'vcf' not found
info<-unique(substr(colnames(het.table)[-c(1:3)],1,8))
#> Error in eval(expr, envir, enclos): object 'het.table' not found
GT<-gt.format(het.table,info) # \dontrun{}
#> Error in eval(expr, envir, enclos): object 'het.table' not found