| gl.report.pa | R Documentation |
This function reports private alleles in one population compared with a second population, for all populations taken pairwise. It also reports a count of fixed allelic differences and the mean absolute allele frequency differences (AFD) between pairs of populations.
gl.report.pa(
x,
x2 = NULL,
method = "pairwise",
loc.names = FALSE,
test.asym = FALSE,
test.asym.boot = 100,
plot.display = FALSE,
matrix.pa = FALSE,
plot.font = 14,
map.interactive = FALSE,
provider = "Esri.NatGeoWorldMap",
palette.discrete = NULL,
plot.file = NULL,
plot.dir = NULL,
verbose = NULL
)
x |
Name of the genlight object containing the SNP or SilicoDArT data [required]. |
x2 |
If two separate genlight objects are to be compared this can be provided here, but they must have the same number of SNPs [default NULL]. |
method |
Method to calculate private alleles: 'pairwise' comparison or compare each population against the rest 'one2rest' [default 'pairwise']. |
loc.names |
Whether names of loci with private alleles and fixed differences should be reported. If TRUE, loci names are reported using a list [default FALSE]. |
test.asym |
Bootstrap test for significant differences of private alleles (see details section) [default FALSE]. |
test.asym.boot |
Number of permutations [default 100]. |
plot.display |
Specify if Sankey plot is to be produced [default FALSE]. |
matrix.pa |
Whether to generate a matrix of private alleles [default FALSE]. |
plot.font |
Numeric font size in pixels for the node text labels [default 14]. |
map.interactive |
Specify whether an interactive map showing private alleles between populations is to be produced [default FALSE]. |
provider |
Passed to leaflet [default "Esri.NatGeoWorldMap"]. |
palette.discrete |
A discrete palette for the color of populations or a list with as many colors as there are populations in the dataset [default NULL, in which case gl.select.colors(x) is used]. |
plot.file |
Name for the RDS binary file to save (base name only, exclude extension) [default NULL] |
plot.dir |
Directory in which to save files [default = working directory] |
verbose |
Verbosity: 0, silent, fatal errors only; 1, flag function begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]. |
Note that the number of paired alleles between two populations is not a symmetric dissimilarity measure.
If no x2 is provided, the function uses the pop(gl) hierarchy to determine pairs of populations, otherwise it runs a single comparison between x and x2.
Hint: in case you want to run comparisons between individuals (assuming individual names are unique), you can simply redefine your population names with your individual names, as below:
pop(gl) <- indNames(gl)
Definition of fixed and private alleles
The table below shows the possible cases of allele frequencies between two populations (0 = homozygote for Allele 1, x = both Alleles are present, 1 = homozygote for Allele 2).
p: cases where there is a private allele in pop1 compared to pop2 (but not viceversa)
f: cases where there is a fixed allele in pop1 (and pop2, as those cases are symmetric)
| pop1 | ||||
| 0 | x | 1 | ||
| 0 | - | p | p,f | |
| pop2 | x | - | - | - |
| 1 | p,f | p | - | |
The absolute allele frequency difference (AFD) in this function is a simple differentiation metric displaying intuitive properties which provides a valuable alternative to FST. For details about its properties and how it is calculated see Berner (2019).
The test for asymmetry of private alleles (test.asym) is a permutation test: for each pair, the genotypes at each locus are permuted among the pooled individuals of the two populations (retaining the original sample sizes), and the ratio of private alleles pop1/(pop1 + pop2) is recomputed for each of test.asym.boot permutations. The reported significance is the proportion of permuted ratios exceeding the observed ratio. Available for SNP data only.
For method 'one2rest', the Chao estimates, the asymmetry test and the interactive map are not reported; they apply to method 'pairwise' only.
The function also reports an estimation of the lower bound of the number of undetected private alleles using the Good-Turing frequency formula, originally developed for cryptography, which estimates in an ecological context the true frequencies of rare species in a single assemblage based on an incomplete sample of individuals. The approach is described in Chao et al. (2017). For this function, equation 2c is used, based on the counts of private alleles observed once and twice in the pooled sample of the two populations compared. The estimate is reported in the output table as Chao1 and Chao2 (SNP data only).
In this function a Sankey Diagram is used to visualize patterns of private alleles between populations. This diagram allows to display flows (private alleles) between nodes (populations). Their links are represented with arcs that have a width proportional to the importance of the flow (number of private alleles).
A data.frame. Each row shows, for each pair of populations the number of individuals in each population, the number of loci with fixed differences (same for both populations) in pop1 (compared to pop2) and viceversa. Same for private alleles and finally the absolute mean allele frequency difference between loci (AFD). If loc.names = TRUE, loci names with private alleles and fixed differences are reported in a list in addition to the dataframe.
Author(s): Bernd Gruber. Custodian: Bernd Gruber – Post to https://groups.google.com/d/forum/dartr
Berner, D. (2019). Allele frequency difference AFD – an intuitive alternative to FST for quantifying genetic population differentiation. Genes, 10(4), 308.
Chao, Anne, et al. "Deciphering the enigma of undetected species, phylogenetic, and functional diversity based on Good-Turing theory." Ecology 98.11 (2017): 2914-2929.
Other matched report:
gl.report.allna(),
gl.report.callrate(),
gl.report.contamination(),
gl.report.excess.het(),
gl.report.factorloadings(),
gl.report.fstat(),
gl.report.hamming(),
gl.report.heterozygosity(),
gl.report.hwe(),
gl.report.ld(),
gl.report.ld.map(),
gl.report.locmetric(),
gl.report.maf(),
gl.report.overshoot(),
gl.report.rdepth(),
gl.report.replicates(),
gl.report.replicates.KING(),
gl.report.reproducibility(),
gl.report.secondaries(),
gl.report.taglength()
if (isTRUE(getOption("dartR_fbm"))) platypus.gl <- gl.gen2fbm(platypus.gl)
out <- gl.report.pa(platypus.gl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.