Learn R Programming

graph4lg (version 1.6.0)

mat_pw_d_j: Compute a pairwise Jost's D matrix between populations

Description

The function computes the pairwise Jost's D matrix between populations from an object of class genind or directly from a GENEPOP file.

Usage

mat_pw_d_j(x, pop_names = NULL)

Arguments

x

An object of class genind, or the character string indicating the path of the GENEPOP file.

pop_names

(optional) A vector of class character of the same length as the number of populations (row and column number in the returned matrix). It contains the name of the populations.

Value

A pairwise matrix of G'ST with as many rows and columns as there are populations in the input data.

Warnings

The order of populations matters :

  • If x is an object of class genind, individuals are re-ordered by populations and populations are ordered in alphabetic order.

  • If x is the path to a GENEPOP file, population order in pop_names must be the same as in the GENEPOP file.

Negative values are converted into 0

Details

The formula used is that of Jost (2008) This functions uses directly the function diffCalc from diveRsity. See https://genepop.curtin.edu.au:443/help_input.html for details on the GENEPOP file format and see Raymond (1995) for detail about GENEPOP software.

References

jost2008gstgraph4lg raymond1995genepopgraph4lg

Examples

Run this code
# NOT RUN {
data("data_ex_genind")
mat_d_j <- mat_pw_d_j(data_ex_genind)

path_in <- system.file('extdata', 'gpop_simul_10_g100_04_20.txt',
                       package = 'graph4lg')
file_n <- file.path(tempdir(), "gpop_simul_10_g100_04_20.txt")
file.copy(path_in, file_n, overwrite = TRUE)
mat_pw_d_j(x = file_n,
           pop_names = as.character(order(as.character(1:10))))
file.remove(file_n)
# }

Run the code above in your browser using DataLab