pair_test: Apply pairwise test to all pairs of haplotypes.

View source: R/pair_test.R

pair_testR Documentation

Apply pairwise test to all pairs of haplotypes.

Description

Pairwise post hoc test. Should only be used if haplotype based test have shown to be significant.

Usage

pair_test(freq, Ne, repli, tdelta)

Arguments

freq

Numeric matrix, with each i,j element being the frequency of haplotype i at sequenced time point j.

Ne

Numeric vector with length as number of replicates, containing information of Ne (effective population size) at each replicated population. If Ne changes over time, take as input a numeric matrix, with the column being the replicate position, row being the Ne at each sequenced time points.

repli

Numeric, specifying the number of replicated populations.

tdelta

Numeric, number of generations between each pair of time points of interests

Value

A numeric vector of p-values from all the pairwise test after B&H corrections. The pairwise test is sorted such that its between haplotypes :1-2, 1-3, 1-4,...,2-3,2-4,...,3-4,...

See Also

haplotest()

Examples

#We show here an example for the pairwise test for fitness differences
#Suppose we have the haplotype frequency matrix hap_freq, sequenced at every 10 generations, with effective population size 1000 and 3 replicate populations, the number of selected haplotypes is computed by:
pair_pval = pair_test(hap_freq, Ne = rep(1000,3), repli = 3, deltat = 10)

xthchen/haplotest documentation built on Nov. 29, 2022, 12:07 p.m.