betas: Estimates betas per population and a bootstrap confidence...

View source: R/betas.R

betasR Documentation

Estimates βs per population and a bootstrap confidence interval

Description

Estimate populations (Population specific FST) or individual coancestries and a bootstrap confidence interval, assuming random mating

Usage

betas(dat,nboot=0,lim=c(0.025,0.975),diploid=TRUE,betaijT=FALSE)

## S3 method for class 'betas'
print(x, digits = 4, ...)

Arguments

dat

data frame with genetic data and pop identifier

nboot

number of bootstrap samples.

lim

width of the bootstrap confidence interval

diploid

whether the data comes from a diploid organism

betaijT

whether to estimate individual coancestries

x

a betas object

digits

number of digits to print

...

further arguments to pass to print

Details

If betaijT=TRUE, and the first column contains a unique identifier for each individual, the function returns the matrix of individual coancestries/kinships. Individual inbreeding coefficients can be obtained by multiplying by 2 the diagonal and substracting 1.

Value

Hi Within population gene diversities (complement to 1 of matching probabilities)

Hb Between populations gene diversities

betaiovl Average \hat{β_{WT}^i} over loci (Population specific FSTs), Table 3 of Weir and Goudet, 2017 (Genetics)

betaW Average of the betaiovl \hat{β_{WT}} over loci (overall population FST)

ci The bootstrap confidence interval of population specific FSTs (only if more than 100 bootstraps requested AND if more than 10 loci are present)

if betaijT=TRUE, return the matrix of pairwise kinships only.

Methods (by generic)

  • print: print function for betas class

Author(s)

Jerome Goudet jerome.goudet@unil.ch

References

Weir and Goudet, 2017 (Genetics) A unified characterization of population structure and relatedness.

See Also

fs.dosage, beta.dosage for Fst estimates (not assuming Random Mating) and kinship estimates from dosage data, respectively

Examples

## Not run: 
#3 different population sizes lead to 3 different betais
dat<-sim.genot(size=40,N=c(50,200,1000),nbloc=50,nbal=10)
betas(dat,nboot=100)
 
#individual coancestries from the smallest population are large
ind.coan<-betas(cbind(1:120,dat[,-1]),betaij=T)
diag(ind.coan$betaij)<-NA
graphics::image(1:120,1:120,ind.coan$betaij,xlab="Inds",ylab="Inds")

## End(Not run)


hierfstat documentation built on May 6, 2022, 1:05 a.m.