Learn R Programming

poolABC (version 1.0.0)

shared: Compute the fraction of sites shared between populations

Description

This function will compute the fraction of sites with a shared polymorphism between populations.

Usage

shared(minor, total, nPops)

Value

a numeric vector with a single entry when nPops is equal to 2 or with three entries when nPops is set to 4.

Arguments

minor

is a matrix with the number of minor-allele reads. Each row of the matrix is a different population and each column a different site.

total

is a matrix with the total coverage. Each row of the matrix is a different population and each column a different site.

nPops

is an integer indicating the total number of populations.

Details

More precisely, we define shared polymorphisms as sites that are segregating in both populations. To clarify, we define segregating sites as sites where the number of minor-allele reads of a given population at a given site are not equal to zero or to the total coverage of that population. We then check if those segregating sites are also segregating in the other population.

For models with two populations, this function compares the two present-day populations. For models with four populations, this function performs a pairwise comparison of the populations at each of the locations. For the models with four populations, we also assess the fraction of sites that are segregating only in one population and not in the other three.