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

gl.reassign.pop

Assign a individual metric as pop in a genlight {adegenet} object


Description

Individuals are assigned to populations based on the individual/sample/specimen metrics file (csv) used with gl.read.dart().

Usage

gl.reassign.pop(x, as.pop, verbose = NULL)

Arguments

x

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

as.pop

– specify the name of the individual metric to set as the pop variable. [required]

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

One might want to define the population structure in accordance with another classification, such as using an individual metric (e.g. sex, male or female). This script discards the current population assignments and replaces them with new population assignments defined by a specified individual metric.

The script returns a genlight object with the new population assignments Note that the original population assigments are lost.

Value

A genlight object with the reassigned populations

Author(s)

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

Examples

# SNP data
   popNames(testset.gl)
   gl <- gl.reassign.pop(testset.gl, as.pop='sex',verbose=3)
   popNames(gl)
# Tag P/A data
   popNames(testset.gs)
   gs <- gl.reassign.pop(testset.gs, as.pop='sex',verbose=3)
   popNames(gs)

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.