Learn R Programming

evobiR (version 1.0)

CalcD: Calculate Patterson's D-statistic

Description

These functions calculate Patterson's D-statistic to compare the frequencies of discordant SNP genealogies. These tests assume equal substitution rates and unlinked loci, D-statistics significantly different from 0 suggest that introgression has occurred.

Usage

CalcD(alignment = "alignment.fasta", boot = F, replicate = 1000)

CalcPartD(alignment = "alignment.fasta", boot = F, replicate = 1000, alpha = 0.05)

CalcPopD(alignment = "alignment.fasta")

Arguments

alignment
This is an alignment in fasta format
boot
This indicates whether or not bootstrapping should be performed to estimate variance
replicate
Number of replicates to be used in estimating variance
alpha
The desired alpha level, used in calculating significance of tests in CalcPartD after Bonferoni correction

Value

  • Returns the number of each type of site, Z scores and p-values

Details

The functions CalcD and CalcPopD are implementations of the algorithm described in Durand et al. 2011. The function CalcPartD is an implementation of the extension that was reported by Eaton and Ree 2013 which extended the original ABBA-BABA test to include additional taxa providing the ability to identify the source population of introgression events when more than one extant lineage may have hybridized with the ingroup.

References

http://www.uta.edu/karyodb/evobiR/

Durand, Eric Y., et al. Testing for ancient admixture between closely related populations. Molecular biology and evolution 28.8 (2011): 2239-2252.

Eaton, D. A. R., and R. H. Ree. 2013. Inferring phylogeny and introgression using RADseq data: An example from flowering plants (Pedicularis: Orobanchaceae). Syst. Biol. 62:689-706

Examples

Run this code
CalcD(alignment = system.file("1.fasta", package = "evobiR"), boot = TRUE, replicate=10)

CalcPartD(alignment = system.file("2.fasta", package = "evobiR"), boot = TRUE, 10)

CalcPopD(alignment = system.file("3.fasta", package = "evobiR"))

Run the code above in your browser using DataLab