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.
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)
A RADdata
object.
Path to the "alleles" file from the Stacks catalog.
Path to the folder containing "matches" files to import.
Either the number 1 or 2, indicating the version of Stacks.
For filtering loci. A locus must have at least this many samples with reads in order to be retained.
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
min.ind.with.haplotype
argument of MergeRareHaplotypes
to consolidate reads from rare alleles.
If TRUE
and version = 1
, the "tags" file from the Stacks catalog will be read,
and chromosome, position, and strand will be imported to the locTable
slot of the output. It is assumed that the "tags" file is in the same
directory as the "alleles" file. If TRUE
and version = 2
,
sumstatsFile
will be used for import of chromosome and position data.
The name of the file containing summary statistics for loci. Ignored
unless version = 2
and readAlignmentData = TRUE
.
A list indicating possible inheritance modes in the dataset.
See RADdata
.
A single integer, or an integer vector with one value per taxon, indicating
ploidy. See RADdata
.
A number from 0 to 1 (generally very small) indicating the expected rate of cross contamination between samples.
Lindsay V. Clark
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.
VCF2RADdata
, readTagDigger
,
readHMC
, readTASSELGBSv2
,
readDArTag
if (FALSE) {
# Assuming the working directory contains the catalog and all matches files:
myStacks <- readStacks("batch_1.catalog.alleles.tsv", ".",
version = 1,
readAlignmentData = TRUE)
}
Run the code above in your browser using DataLab