View source: R/gl2demerelate.r
| gl2demerelate | R Documentation |
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.
gl2demerelate(x, verbose = NULL)
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]. |
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.
A dataframe suitable as input to package {Demerelate}
Author(s): Luis Mijangos. Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr
Other linker:
gi2gl(),
gl2bayesAss(),
gl2bayescan(),
gl2bpp(),
gl2eigenstrat(),
gl2faststructure(),
gl2gapit(),
gl2gds(),
gl2genalex(),
gl2genepop(),
gl2geno(),
gl2gi(),
gl2hapmap(),
gl2hiphop(),
gl2related(),
gl2snapper(),
gl2structure(),
gl2treemix(),
gl2vcf()
if (isTRUE(getOption("dartR_fbm"))) testset.gl <- gl.gen2fbm(testset.gl)
df <- gl2demerelate(testset.gl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.