gl2demerelate: Creates a dataframe suitable for input to package...

View source: R/gl2demerelate.r

gl2demerelateR Documentation

Creates a dataframe suitable for input to package {Demerelate} from a genlight {adegenet} object

Description

Converts a genlight object containing SNP data into a dataframe in the format expected by package {Demerelate} for estimating pairwise relatedness: one row per individual, with the sample identifier and population followed by two adjacent allele columns per locus.

Usage

gl2demerelate(x, verbose = NULL)

Arguments

x

Name of the genlight object containing the SNP data [required].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default NULL, adopting the global verbosity set by gl.set.verbosity(), or 2 if no global is set].

Details

Each SNP genotype is recoded as a pair of alleles labelled 1 (reference) and 2 (alternate): 0 becomes 1/1, 1 becomes 1/2, 2 becomes 2/2, and missing genotypes are retained as NA in both allele columns, which Demerelate reads as missing. The two allele columns for each locus are suffixed _1 and _2 and kept adjacent. Locus names are sanitized for Demerelate: '-' and '|' are replaced with '_' and '/' is removed.

Value

A dataframe suitable as input to package {Demerelate}

Author(s)

Author(s): Luis Mijangos. Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr

See Also

Other linker: gi2gl(), gl2bayesAss(), gl2bayescan(), gl2bpp(), gl2eigenstrat(), gl2faststructure(), gl2gapit(), gl2gds(), gl2genalex(), gl2genepop(), gl2geno(), gl2gi(), gl2hapmap(), gl2hiphop(), gl2related(), gl2snapper(), gl2structure(), gl2treemix(), gl2vcf()

Examples

if (isTRUE(getOption("dartR_fbm"))) testset.gl <- gl.gen2fbm(testset.gl)
df <- gl2demerelate(testset.gl)


dartR.base documentation built on Nov. 18, 2026, 9:06 a.m.