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

gl.collapse

Collapse a distance matrix by amalgamating populations with pairwise fixed difference count less that a threshold


Description

This script takes a the file generated by gl.fixed.diff and amalgamates populations with distance less than or equal to a specified threshold. The distance matrix is generated by gl.fixed.diff().

Usage

gl.collapse(fd, tpop = 0, tloc = 0, pb = FALSE, verbose = NULL)

Arguments

fd

– name of the list of matricies produced by gl.fixed.diff() [required]

tpop

– threshold number of fixed differences above which populatons will not be amalgamated [0]

tloc

– threshold defining a fixed difference (e.g. 0.05 implies 95:5 vs 5:95 is fixed) [0]

pb

– if TRUE, show a progress bar on time consuming loops [FALSE]

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 script then applies the new population assignments to the genlight object and recalculates the distance and associated matricies.

Value

A list containing the gl object x and the following square matricies [[1]] $gl – the new genlight object with populations collapsed; [[2]] $fd – raw fixed differences; [[3]] $pcfd – percent fixed differences; [[4]] $nobs – mean no. of individuals used in each comparison; [[5]] $nloc – total number of loci used in each comparison; [[6]] $expfpos – NA's, populated by gl.fixed.diff [by simulation] [[7]] $expfpos – NA's, populated by gl.fixed.diff [by simulation] [[8]] $prob – NA's, populated by gl.fixed.diff [by simulation]

Author(s)

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

Examples

fd <- gl.fixed.diff(testset.gl,tloc=0.05)
fd
fd2 <- gl.collapse(fd,tpop=1)
fd2
fd3 <- gl.collapse(fd2,tpop=1)
fd3

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.