sweeplink-vcf2input¶
Converts a VCF and a sample list into the two files sweepLink reads: an allele counts file and a meta file.
$ sweeplink-vcf2input \
--vcf data/example.vcf.gz \
--samples data/samples.txt \
--time-direction bp \
--out-prefix doc
That writes doc_alleleCounts.txt and doc_meta.txt, and prints a table of how
many samples and sites survived at each time point — worth reading before you
rely on the oldest samples, which in ancient DNA are usually the thinnest.
Required¶
--vcf <file>Input VCF or BCF; may be bgzipped. A
.tbi/.csiindex is only needed with--region.--samples <file>Tab-separated sample list with
sample,populationandtime_in_gencolumns — see file formats. Lines starting with#are ignored.--out-prefix <prefix>Prefix for the two output files.
--time-direction <bp|forward>How to read the
time_in_gencolumn. Required, with no default, because getting it wrong silently reverses your time series.bp— before present: a larger number is older.forward— forward in time: a smaller number is older.
Either way the meta file comes out in sweepLink’s own convention, where time runs forward and 0 is the oldest point.
Optional¶
--region <chr:start-end>Convert only part of the VCF, e.g.
chr2:1-5000. Needs an indexed VCF.--ploidy <diploid|pseudo-haploid>How to count alleles per individual. Default
diploid— both alleles are counted, so each individual contributes 2 ton. Usepseudo-haploidfor low-coverage ancient DNA, where one allele is sampled per individual and each contributes 1.
Filtering¶
All filters are applied while reading, and the counts of what they removed appear in the printed summary.
--min-mac <n>Minimum minor allele count across all populations and time points. Default 1, i.e. keep everything.
2drops singletons,3also drops doubletons.--no-singletonsEquivalent to
--min-mac 2. If--min-macis set higher, the higher value wins.--min-maf <f>Minimum minor allele frequency across all time points and populations. Default
0.0.--min-segregating-timepoints <n>Keep only sites that segregate in at least this many time points. Default 1.
--segregating-scope <any|all>What “segregating at a time point” means when there is more than one population — segregating in any population (default) or in all of them.
--max-missing-recent <f>Maximum fraction of missing data allowed at the most recent time point, e.g.
0.2for 20%. Default1.0(off).--max-missing-total <f>Maximum fraction of missing genotypes across all populations and time points. Default
1.0(off).
Tip
Monomorphic sites carry no information about selection and are the largest single category dropped on most datasets. Filtering harder than that trades sensitivity for runtime — sweepLink handles low counts and missing data directly, so there is little to gain from aggressive minor-allele filtering.
Output¶
Both files are described in file formats. Missing data
is written 0/0.