readStacks {polyRAD} | R Documentation |
Import Read Depth from Stacks
Description
Using the catalog files output by cstacks and matches file output by sstacks,
this function imports read depth into a RADdata
object. If
genomic alignments were used, alignment data can optionally be imported.
Usage
readStacks(allelesFile, matchesFolder, version = 2,
min.ind.with.reads = 200,
min.ind.with.minor.allele = 10, readAlignmentData = FALSE,
sumstatsFile = "populations.sumstats.tsv",
possiblePloidies = list(2), taxaPloidy = 2L, contamRate = 0.001)
Arguments
allelesFile |
Path to the "alleles" file from the Stacks catalog. |
matchesFolder |
Path to the folder containing "matches" files to import. |
version |
Either the number 1 or 2, indicating the version of Stacks. |
min.ind.with.reads |
For filtering loci. A locus must have at least this many samples with reads in order to be retained. |
min.ind.with.minor.allele |
For filtering loci. A locus must have at least this many samples with
reads for the minor allele in order to be retained. For loci with more
than two alleles, at least two alleles must be present in at least this
many individuals. This argument is also passed internally to the
|
readAlignmentData |
If |
sumstatsFile |
The name of the file containing summary statistics for loci. Ignored
unless |
possiblePloidies |
A list indicating possible inheritance modes in the dataset.
See |
taxaPloidy |
A single integer, or an integer vector with one value per taxon, indicating
ploidy. See |
contamRate |
A number from 0 to 1 (generally very small) indicating the expected rate of cross contamination between samples. |
Value
A RADdata
object.
Note
This function has been tested with output from Stacks 1.47.
Author(s)
Lindsay V. Clark
References
Stacks website: http://catchenlab.life.illinois.edu/stacks/
Rochette, N. and Catchen, J. (2017) Deriving genotypes from RAD-seq short-read data using Stacks. Nature Protocols 12, 2640–2659.
Catchen, J., Hohenlohe, P. A., Bassham, S., Amores, A., and Cresko., W. A. (2013) Stacks: an analysis tool set for population genomics. Molecular Ecology 22, 3124–3140.
Catchen, J. M., Amores, A., Hohenlohe, P., Cresko, W., and Postlethwait, J. H. (2011) Stacks: building and genotyping loci de novo from short-read sequences. G3: Genes, Genomes, Genetics 1, 171–182.
See Also
VCF2RADdata
, readTagDigger
,
readHMC
, readTASSELGBSv2
,
readDArTag
Examples
## Not run:
# Assuming the working directory contains the catalog and all matches files:
myStacks <- readStacks("batch_1.catalog.alleles.tsv", ".",
version = 1,
readAlignmentData = TRUE)
## End(Not run)