Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gl.dist.ind

Calculate a distance matrix for individuals defined in an {adegenet} genlight object


Description

This script calculates various distances between individuals based on allele frequencies. The distances are calculated by scripts in the stats or vegan libraries, with the exception of the pcfixed (percent fixed differences) distance.

Usage

gl.dist.ind(x, method = NULL, plot = TRUE, verbose = NULL)

Arguments

x

– name of the genlight containing the SNP genotypes [required]

method

– Specify distance measure [SNP: Euclidean; P/A: Simple]

plot

– if TRUE, display a histogram and a boxplot of the genetic distances [TRUE]

verbose

– verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]

Details

The distance measure for SNP data can be one of

Euclidean – Euclidean distance as computed by dist() in stat locus.count – number of loci for which individuals differ, as implemented by dist.gene() in ape allele.count – number of allelic differences between two individuals, as implemented by diss.dist() in poppr relatedness – genetic relatedness between individuals (G matrix), as implemented by A.mat() in rrBLUP

The distance measure for Tag P/A data (binary) can be one of

Simple – simple matching, both 1 or both 0 = 0; one 1 and the other 0 = 1. Presence and absence equally weighted. Jaccard – ignores matching 0, both 1 = 0; one 1 and the other 0 = 1. Absences could be for different reasons. Dice – both 0 = 0; both 1 = 2; one 1 and the other 0 = 1. Absences could be for different reasons. Sometimes called the Czekanowski or Sorensen distance. Phi – binary analogue of the Pearson Correlation coefficient.

Refer to the documentation in the relevant packages listed above.

Value

An object of class 'dist' giving distances between individuals

Author(s)

Arthur Georges (Post to https://groups.google.com/d/forum/dartr)

Examples

gl.dist.pop(testset.gl, method="euclidean")

dartR

Importing and Analysing SNP and Silicodart Data Generated by Genome-Wide Restriction Fragment Analysis

v1.9.6
GPL-2
Authors
Bernd Gruber [aut, cre], Arthur Georges [aut], Jose L. Mijangos [aut], Peter J. Unmack [ctb], Oliver Berry [ctb], Lindsay V. Clark [ctb], Floriaan Devloo-Delva [ctb]
Initial release
2021-04-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.