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

gl.utils.fdsim

Estimate the rate of false positives in a fixed difference analysis


Description

This is a support script, called by gl.fixed.diff and gl.collapse.recursive. The script takes two populations and generates allele frequency profiles for them. It then samples an allele frequency for each, at random, and estimates a sampling distribution for those two allele frequencies. Drawing two samples from those sampling distributions, it calculates whether or not they represent a fixed difference. This is applied to all loci, and the number of fixed differences so generated are counted, as an expectation. The script distinguished between true fixed differences (with a tolerance of delta), and false positives. The simulation is repeated a given number of times (default=1000) to provide an expectation of the number of false positives, given the observed allele frequency profiles and the sample sizes. The probability of the observed count of fixed differences is greater than the expected number of false positives is calculated.

Usage

gl.utils.fdsim(
  gl,
  poppair,
  obs,
  sympatric = FALSE,
  reps = 1000,
  delta = 0.02,
  verbose = NULL
)

Arguments

gl

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

poppair

– labels of two populations for comparison in the form c(popA,popB) [required]

obs

– observed number of fixed differences between the two populations [required]

sympatric

– if TRUE, the two populations are sympatric, if FALSE then allopatric [FALSE]

reps

– number of replications to undertake in the simulation [default 1000]

delta

– the threshold value for the minor allele frequency to regard the difference between two populations to be fixed [default 0.02]

verbose

– verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2]

Value

A list containing the following square matricies [[1]] observed fixed differences; [[2]] mean expected number of false positives for each comparison; [[3]] standard deviation of the no. of false positives for each comparison; [[4]] probability the observed fixed differences arose by chance for each comparison.

Author(s)

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


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.