Run STACKS populations module inside R!
run_populations(
P = "06_ustacks_2_gstacks",
V = NULL,
O = "07_populations",
M,
parallel.core = parallel::detectCores() - 1,
batch.size = 10000,
p = 1,
r = 0.3,
R = 0.3,
H = TRUE,
min.maf = NULL,
min.mac = NULL,
max.obs.het = NULL,
write.single.snp = FALSE,
write.random.snp = FALSE,
B = NULL,
W = NULL,
e = NULL,
merge.sites = FALSE,
merge.prune.lim = NULL,
hwe = FALSE,
fstats = FALSE,
fst.correction = NULL,
p.value.cutoff = 0.05,
k = FALSE,
smooth.fstats = FALSE,
smooth.popstats = FALSE,
sigma = 150000,
bootstrap = FALSE,
N = 100,
bootstrap.pifis = FALSE,
bootstrap.fst = FALSE,
bootstrap.div = FALSE,
bootstrap.phist = FALSE,
bootstrap.wl = NULL,
ordered.export = FALSE,
fasta.samples = TRUE,
fasta.samples_raw = FALSE,
fasta.loci = TRUE,
vcf = TRUE,
genepop = FALSE,
structure = FALSE,
radpainter = FALSE,
phase = FALSE,
fastphase = FALSE,
plink = FALSE,
hzar = FALSE,
phylip = FALSE,
phylip.var = FALSE,
phylip.var.all = FALSE,
treemix = FALSE,
no.hap.exports = FALSE,
h = FALSE,
verbose = FALSE,
v = FALSE,
log.fst.comp = FALSE
)
(path, character) Path to the directory containing all the STACKS files.
Default: P = "06_ustacks_2_gstacks"
.
(character) Path to an input VCF file. When this module is used to
filter an existing vcf file.
Default: V = NULL
.
(character) Path to a directory where to write the output files.
With default: O = "07_populations"
, the function creates a folder inside
07_populations
, with date and time appended to populations_
.
path to a population map file. The format is a tab-separated file,
with first column containing sample name and second column population id.
No heather (column name).
e.g. M = "02_project_info/population.map.catalog.tsv"
(integer) enable parallel execution with num_threads threads.
Default: parallel.core = parallel::detectCores() - 1
(integer) The number of loci (de novo mode) or
chromosome (reference mode), to process in a batch.
Increase to speed analysis, uses more memory, decrease to save memory).
Default in de novo mode (loci/batch): batch.size = 10000
.
Default in reference mode (chromosome/batch): batch.size = 1
.
(integer) Minimum number of populations a locus must be present in to process a locus.
Default: p = 1
.
(double) Minimum percentage of individuals in a population required to process a locus for that population.
Default: r = 0.3
.
(double) Minimum percentage of individuals across populations required to process a locus.
Default: r = 0.3
.
(logical) Apply the above filters haplotype wise
(unshared SNPs will be pruned to reduce haplotype-wise missing data).
Default: H = TRUE
.
(double) Specify a minimum minor allele frequency required to process a nucleotide site at a locus (0 < min.maf < 0.5).
Default: min.maf = NULL
. Recommendation: use my other R package RADIATOR to filter data based on MAF.
(integer) Specify a minimum minor allele count required to process a nucleotide site at a locus.
Default: min.mac = NULL
.
(double) Specify a maximum observed heterozygosity required to process a nucleotide site at a locus.
Default: max.obs.het = NULL
. Recommendation: use my other R package RADIATOR to filter data based on heterozygosity.
(logical) Restrict data analysis to only the first SNP per locus (implies –no-haps).
Default: write.single.snp = FALSE
.
(logical) Restrict data analysis to one random SNP per locus (implies –no-haps).
Default: write.random.snp = FALSE
.
(character) Path to a file containing Blacklisted markers to be excluded from the export.
Default: B = NULL
.
(character) Path to a file containing Whitelisted markers to include in the export.
Default: W = NULL
.
(character) Restriction enzyme name.
Default: e = NULL
.
(logical) Merge loci that were produced from the same restriction enzyme cutsite (requires reference-aligned data).
Default: merge.sites = FALSE
.
(integer) When merging adjacent loci, if at least X
Default: merge.prune.lim = NULL
.
(logical) Calculate divergence from Hardy-Weinberg equilibrium
using the exact test at the SNP level and Guo and Thompson MCMC algorithm at
the haplotype level.
Default: hwe = FALSE
.
(logical) Enable SNP and haplotype-based F statistics.
Default: fstats = FALSE
.
(character) Specify a correction to be applied to Fst values: 'p_value', 'bonferroni_win', or 'bonferroni_gen'.
Default: fst.correction = NULL
.
(double) maximum p-value to keep an Fst measurement.
Also used as base for Bonferroni correction.
Default: p.value.cutoff = 0.05
.
(logical) Enable kernel-smoothed Pi, Fis, Fst, Fst', and Phi_st calculations.
Default: k = FALSE
.
(logical) Enable kernel-smoothed Fst, Fst', and Phi_st calculations.
Default: smooth.fstats = FALSE
.
(logical) Enable kernel-smoothed Pi and Fis calculations.
Default: smooth.popstats = FALSE
.
(integer) Standard deviation of the kernel smoothing weight distribution.
Default: sigma = 150000
(150kb).
(logical) Turn on boostrap resampling for all smoothed statistics.
Default: bootstrap = FALSE
.
(integer) Number of bootstrap resamplings to calculate.
Default: N = 100
.
(logical) Turn on boostrap resampling for smoothed SNP-based Pi and Fis calculations.
Default: bootstrap.pifis = FALSE
.
(logical) Turn on boostrap resampling for smoothed Fst calculations based on pairwise population comparison of SNPs.
Default: bootstrap.fst = FALSE
.
(logical) Turn on boostrap resampling for smoothed haplotype diveristy and gene diversity calculations based on haplotypes.
Default: bootstrap.div = FALSE
.
(logical) Turn on boostrap resampling for smoothed Phi_st calculations based on haplotypes.
Default: bootstrap.phist = FALSE
.
(character) Path to a whitelist file. Only use bootstrap loci contained in this whitelist.
Default: bootstrap.wl = NULL
.
(logical) If data is reference aligned, exports will be ordered; only a single representative of each overlapping site.
Default: ordered.export = FALSE
.
(logical) Output the sequences of the two haplotypes of each (diploid) sample, for each locus, in FASTA format.
stackr default is different than stacks default because I think having this info helps to identify problems.
Default: fasta.samples = TRUE
.
(logical) Output all haplotypes observed in each sample, for each locus, in FASTA format.
Default: fasta.samples_raw = FALSE
.
(logical) Output consensus sequences of all loci, in FASTA format.
stackr default is different than stacks default because I think having this info helps to identify problems.
Default: fasta.loci = TRUE
.
(logical) Output SNPs in Variant Call Format (VCF).
Default: vcf = TRUE
.
(logical) Output results in GenePop format.
Default: genepop = FALSE
.
(logical) Output results in Structure format.
Default: structure = FALSE
.
(logical) Output results results in fineRADstructure/RADpainter format.
Default: radpainter = FALSE
.
(logical) Output genotypes in PHASE format.
Default: phase = FALSE
.
(logical) Output genotypes in fastPHASE format.
Default: fastphase = FALSE
.
(logical) Output genotypes in PLINK format.
Default: plink = FALSE
.
(logical) Output genotypes in Hybrid Zone Analysis using R (HZAR) format.
Default: hzar = FALSE
.
(logical) Output nucleotides that are fixed-within, and variant among populations in Phylip format for phylogenetic tree construction.
Default: phylip = FALSE
.
(logical) Include variable sites in the phylip output encoded using IUPAC notation.
Default: phylip.var = FALSE
.
(logical) Include all sequence as well as variable sites in the phylip output encoded using IUPAC notation.
Default: phylip.var.all = FALSE
.
(logical) Output SNPs in a format useable for the TreeMix program (Pickrell and Pritchard).
Default: treemix = FALSE
.
(logical) Omit haplotype outputs.
Default: no.hap.exports = FALSE
.
Display this help messsage.
Default: h = FALSE
turn on additional logging.
Default: verbose = FALSE
print program version.
Default: v = FALSE
(logical) Log components of Fst/Phi_st calculations to a file.
Default: log.fst.comp = FALSE
populations returns different output depending on arguments selected.
Catchen JM, Amores A, Hohenlohe PA et al. (2011) Stacks: Building and Genotyping Loci De Novo From Short-Read Sequences. G3, 1, 171-182.
Catchen JM, Hohenlohe PA, Bassham S, Amores A, Cresko WA (2013) Stacks: an analysis tool set for population genomics. Molecular Ecology, 22, 3124-3140.
Guo SW, Thompson EA (1992) Performing the exact test of Hardy-Weinberg proportion for multiple alleles. Biometrics, 48, 361-372.
if (FALSE) { # \dontrun{
pop <- stackr::run_populations(M = "population.map.tsv")
} # }