Learn R Programming

rehh (version 3.2.2)

haplohh2sweepfinder: Translate object of haplohh-class into SweepFinder format

Description

Extract allele frequencies of an object of class haplohh-class and returns a table in SweepFinder input format.

Usage

haplohh2sweepfinder(haplohh, polarized = TRUE, verbose = TRUE)

Arguments

haplohh

object of class haplohh-class.

polarized

logical. If TRUE (default), flag "folded" is set to 0, otherwise to 1.

verbose

logical. If TRUE (default), prints filter statements.

Value

A dataframe with four columns:

  • position marker position

  • x (absolute) frequency of the alternative (derived) variant

  • n number of non-missing genotypes

  • folded a flag marking polarization

Details

SweepFinder and SweeD are two stand-alone programs which implement the same method to detect selective sweeps using the allele frequency at each site. This function calculates these frequencies from a haplohh-class and returns a table which can be saved into a file (with tabs as separators, without row names and quotes) that can be used as input for the two programs.

Sites with less than two haplotypes genotyped or with more than two alleles are removed. If polarized, sites monomorphic for the ancestral allele are removed, too.

References

DeGiorgio, M., and, Huber, CD and Hubisz, MJ and, Hellmann, I. and Nielsen, R. (2016) SweepFinder2: increased robustness and flexibility. Bioinformatics 32:1895-1897

Pavlidis, P., D. Zivkovic, A. Stamatakis, and N. Alachiotis, (2013) SweeD: likelihood-based detection of selective sweeps in thousands of genomes. Molecular Biology and Evolution 30: 2224-34.

See Also

haplohh-class, data2haplohh

Examples

Run this code
# NOT RUN {
#example
# sweepfinder example from vignette
make.example.files()
hh <- data2haplohh("example_sweep_with_recombination.vcf")
haplohh2sweepfinder(hh)
remove.example.files()
# }

Run the code above in your browser using DataLab