populations_setup: batch setup populations For each set samples (processed with...

View source: R/stacks.R

populations_setupR Documentation

batch setup populations For each set samples (processed with ustacks, cstacks, sstacks, and tsv2bam) and a population map, this function creates a bash job file to run populations. The output of this function is a character string vector with paths to bash job files, which can be piped to the function 'rsbatch' to submit the jobs.

Description

batch setup populations

For each set samples (processed with ustacks, cstacks, sstacks, and tsv2bam) and a population map, this function creates a bash job file to run populations. The output of this function is a character string vector with paths to bash job files, which can be piped to the function 'rsbatch' to submit the jobs.

Usage

populations_setup(
  save.in,
  use.popmap = FALSE,
  popmap = NULL,
  include.out = c("fasta-loci", "fasta-samples", "vcf", "genepop", "structure",
    "radpainter", "plink", "hzar", "phylip", "phylip-var", "phylip-var-all", "treemix",
    "fasta-samples-raw"),
  t = 16,
  populations.path = NULL
)

Arguments

save.in

Character string with directory where output directories and files should be saved. This should be the same as the value used for the 'save.in' argument of ustacks_setup.

use.popmap

Logical indicating whether or not to assign individuals to different populations according to a population map. Default FALSE.

popmap

Character string to population map. Default NULL, in which case all individuals in 'save.in' are assigned to the same 'population'.

include.out

Character string vector indicating which output files should be generated. Default is to include all the files possible. See STACKS for explanation. fasta-loci — output locus consensus sequences in FASTA format.. fasta-samples — output the sequences of the two haplotypes of each (diploid) sample, for each locus, in FASTA format. vcf — output SNPs and haplotypes in Variant Call Format (VCF). genepop — output results in GenePop format. structure — output results in Structure format. radpainter — output results in fineRADstructure/RADpainter format. plink — output genotypes in PLINK format. hzar — output genotypes in Hybrid Zone Analysis using R (HZAR) format. phylip — output nucleotides that are fixed-within, and variant among populations in Phylip format for phylogenetic tree construction. phylip-var — include variable sites in the phylip output encoded using IUPAC notation. phylip-var-all — include all sequence as well as variable sites in the phylip output encoded using IUPAC notation. treemix — output SNPs in a format useable for the TreeMix program (Pickrell and Pritchard). no-hap-exports — omit haplotype outputs. fasta-samples-raw — output all haplotypes observed in each sample, for each locus, in FASTA format.

t

Number of threads to use for job parallization. Default 16.

populations.path

Character string with path to the populations executable. Default NULL, in which case the path is derived from the default setting, which can be set with config_miscwrappers('<path/to/populations>').

Value

Character string vector with the paths to bash job files.


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