View source: R/gl.select.panel.R
| gl.select.panel | R Documentation |
This function selects a panel of loci from a genomic dataset ('dartR or genlight' object) based on various selection methods.
gl.select.panel(
x,
method = "random",
nl = 10,
exact = TRUE,
plot.out = TRUE,
plot.file = NULL,
plot.dir = NULL,
verbose = NULL
)
x |
A 'dartR or genlight' object containing the genomic data. |
method |
A character string specifying the selection method. Options include:
|
nl |
An integer specifying the number of loci to select. |
exact |
Logical. If 'TRUE', ensures that the number of selected loci is exactly 'nl'. If 'FALSE', allows for a random selection that may not match 'nl' exactly. |
plot.out |
Logical. If 'TRUE', generates plots summarizing selected loci. |
plot.file |
A character string specifying the file name for saving plots. If 'NULL', plots are not saved. |
plot.dir |
A character string specifying the directory to save plots. Defaults to the working directory. |
verbose |
Integer level of verbosity for reporting progress and information. |
The function applies various methods to select loci based on the input 'dartR or genlight' object. Each method has specific criteria for selecting loci:
'dapc': Performs DAPC and identifies loci with the highest contributions to discrimination between population pairs.
'pahigh': Identifies loci with private alleles that have high frequency differences between populations.
'random': Selects loci randomly.
'monopop': Selects loci that are monomorphic within populations.
'stratified': Uses stratified sampling to select loci based on allele frequencies.
'hafall': Selects loci with the highest allele frequencies across the dataset.
'hafpop': Selects loci with the highest allele frequencies within individual populations.
'pic': Selects loci based on the highest polymorphic information content (PIC).
‘picdart': Selects loci based on the average PIC calculated from the ’dartR' metrics.
A 'dartR or genlight' object containing the selected loci.
# Example usage:
# Select 20 loci randomly
selected <- gl.select.panel(possums.gl, method = "random", nl = 50)
# Select loci based on DAPC
selected <- gl.select.panel(possums.gl, method = "dapc", nl = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.