freqs2pairwisePi: Calculate pairwise pi between all pairs of individuals in a...

Description Usage Arguments Details Value

View source: R/stats.R

Description

Calculate pairwise pi between all pairs of individuals in a dataset

Usage

1
freqs2pairwisePi(freqs, coGeno = NULL, quiet = FALSE)

Arguments

freqs

A genotype matrix with N rows and L columns, where N is the number of individuals and L is the number of loci, for which the i,jth element gives the frequency of the counted allele in each individual at each locus.

coGeno

A symmetric matrix (dimensions N x N) for which the i,jth element gives the number of base pairs genotyped in both samples i and j. Default is NULL. If left unspecified, each cell will be assigned a value of L (i.e., indicating no missing data).

quiet

A logical value that controls whether a progress par is displayed. Default is FALSE.

Details

The genotype data should consist of 0,0.5,1 with missing data indicated with NA. If the genotype matrix consists only of polymorphic loci, and coGeno either contains the number of co-genotyped polymorphic loci for each sample pair or is not specified this function will return pairwise pi at polymorphic sites, which may not be comparable across datasets.

Value

An estimate of pairwise pi between all individuals in the data matrix.


gbradburd/popgenstuff documentation built on Oct. 16, 2021, 12:05 a.m.