run_sstacks: Run STACKS sstacks module

Description Usage Arguments Details Value References See Also Examples

View source: R/run_sstacks.R

Description

Run STACKS sstacks module inside R! Inside the P folder (where the ustacks and the cstacks files are), you should have:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
run_sstacks(
  P = "06_ustacks_2_gstacks",
  M = NULL,
  sample.list = NULL,
  c = "06_ustacks_2_gstacks",
  parallel.core = parallel::detectCores() - 1,
  o = "06_ustacks_2_gstacks",
  x = FALSE,
  disable.gapped = FALSE,
  v = FALSE,
  h = FALSE
)

Arguments

P

(character) Path to the directory containing STACKS files. Contrary to sstacks, this argument can be use with sample.list (the s in sstacks) Default: P = "06_ustacks_2_gstacks".

M

(character) Path to a population map file from which to take sample names (this argument won't work if sample.list). Advice: don't modify the default (please see details). Default: M = NULL.

sample.list

This is for the s option in sstacks. s: Filename prefix from which to load sample loci. Here, you have 2 choices: 1. you leave empty and let the function use the default:sample.list = NULL which will scan for the files in the P folder given above. 2. you supply a character string of the samples. This could come from the INDIVIDUALS_REP column of the project info file, e.g. sample.list = project.info$INDIVIDUALS_REP. (Please see details).

c

(character, path) Path to the catalog. Default: c = "06_ustacks_2_gstacks"

parallel.core

(Integer) Enable parallel execution with num_threads threads. Default: parallel.core = parallel::detectCores() - 1

o

output path to write results. Default: o = "06_ustacks_2_gstacks"

x

Don't verify haplotype of matching locus. Default: x = FALSE

disable.gapped

Disable gapped alignments between stacks. Default: disable.gapped = FALSE (use gapped alignments).

v

Print program version. Default: v = FALSE

h

Display this help messsage. Default: h = FALSE

Details

Computer or server problem during the sstacks ? Just launch again the same command, the function will start again, but only with the unmatched samples!

Some argument can't be use together:

Don't use these arguments together: M and sample.list/c. You can't add samples to an existing catalog using a population map. If you want to match new samples to an existing catalog, very easy, just add the samples in the folder and let run_sstacks function find the samples that were not matched to the catalog.

Value

sstacks returns a .matches.tsv.gz file for each sample. If lnl_dist = TRUE, the function will also return a summary of catalog loci log-likelihood.

References

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.

See Also

sstacks

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# The simplest form of the function when using the stackr workflow:
run_sstacks()
# that's it !


Now if you have your own workflow folders, etc. Enter them like this:
sstacks <- run_sstacks (P = "/my/input/path", p = 32, b = 2,
sample.list = c("ind1", "ind2", "..."), o = "/my/output/path",
x = FALSE)

## End(Not run)

thierrygosselin/stackr documentation built on Nov. 11, 2020, 11 a.m.