nei: Calculate the pairwise Nei distance

Description Usage Arguments Format Details Examples

View source: R/nei.R

Description

Given a allele_count matrix, it computes Nei distance and its bootstrap replications between all pairs of population using different methods.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
nei_methods

nei(ac, method = nei_methods)

bootstrap_nei(
  ac,
  method = nei_methods,
  boots = 100L,
  block = 10L,
  as_matrix = FALSE
)

Arguments

ac

allele count matrix for which to compute nei's distance.

method

nei's distance estimator method, with fast as default.

boots

number of bootstrap replicates to perform

block

statistic blocking size

as_matrix

if TRUE, then return a matrix whith bootstrap interations as rows and pairwise comparisons as columns.

Format

An object of class character of length 3.

Details

The estimator methods include two implementations of the standard Nei's genetic distance (fast and safe), as described in Nei (1972), and Nei's Da (da), described in Nei et al. (1983). Both Nei's distance (standard and Da) measures genetic differences caused by mutation and genetic drift with Da result in more reliable results for microsatellite data, but more sensible to small population sizes.

Two versions of standard Nei's distance were implemented, safe and fast. The fast implementation is 2 times faster than safe, but can introduce errors when there is data missing, if no missing data is present it results the same result as the safe implementation.

Examples

1
2
3
4
5
6
7
8
c <- matrix(sample(1:10, 250, replace = TRUE), ncol = 10, nrow = 25)
n <- matrix(10, ncol = 10, nrow = 25)
ac <- allele_count(c, n)
## Summarized Nei
nei(ac)
nei(ac, "safe")

bootstrap_nei(ac)

andremrsantos/htspop documentation built on May 14, 2020, 11:40 a.m.