Description Usage Arguments Details Value References See Also Examples
View source: R/haplohh2sweepfinder.R
Extract allele frequencies of an object of class haplohh-class
and returns a table in SweepFinder input format.
1 | haplohh2sweepfinder(haplohh, polarized = TRUE, verbose = TRUE)
|
haplohh |
object of class |
polarized |
logical. If |
verbose |
logical. If |
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.
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
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.
1 2 3 4 5 6 | #example
# sweepfinder example from vignette
make.example.files()
hh <- data2haplohh("example_sweep_with_recombination.vcf")
haplohh2sweepfinder(hh)
remove.example.files()
|
* Reading input file(s) *
Using package 'data.table' to read vcf.
Extracting map information.
Extracting ancestral allele from info field of vcf file.
Extracting haplotypes.
Number of individuals which are
Haploid Diploid Triploid, ... :
1 2
0 4
Polarizing variants.
11 markers have been polarized.
0 unpolarized markers have been removed.
* Filtering data *
Discard markers genotyped on less than 100 % of haplotypes.
No marker discarded.
Data consists of 8 haplotypes and 11 markers.
Number of mono-, bi-, multi-allelic markers:
1 2
0 11
* Filtering data *
Discard markers genotyped on less than 25 % of haplotypes.
No marker discarded.
Discard markers with more than 2 different alleles.
No marker discarded.
Data consists of 8 haplotypes and 11 markers.
Number of mono-, bi-, multi-allelic markers:
1 2
0 11
position x n folded
s1 10000 1 8 0
s2 20000 4 8 0
s3 30000 1 8 0
s4 40000 5 8 0
s5 50000 1 8 0
s6 60000 7 8 0
s7 70000 6 8 0
s8 80000 1 8 0
s9 90000 4 8 0
s10 100000 1 8 0
s11 110000 2 8 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.