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

gl.subsample.loci

Subsample n loci from a genlight object and return as a genlight object


Description

This is a support script, to subsample a genlight {adegenet} object based on loci. Two methods are used to subsample, random and based on information content (avgPIC).

Usage

gl.subsample.loci(x, n, method = "random", mono.rm = FALSE, verbose = NULL)

Arguments

x

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

n

– number of loci to include in the subsample [required]

method

– "random", in which case the loci are sampled at random; or avgPIC, in which case the top n loci ranked on information content (AvgPIC) are chosen [default 'random']

mono.rm

– delete monomorphic loci before sampling [default 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]

Value

A genlight object with n loci

Author(s)

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

Examples

# SNP data
  gl2 <- gl.subsample.loci(testset.gl, n=200, method="pic")
# Tag P/A data
  gl2 <- gl.subsample.loci(testset.gl, n=100, method="random")

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.