The locus metadata supplied by DArT has FreqHets included, but the frequency of the heterozygotes will change when some individuals are removed from the dataset. This script recalculates the FreqHets and places these recalculated values in the appropriate place in the genlight object. Note that the frequency of the homozygote reference SNPS is calculated from the individuals that could be scored.
utils.recalc.freqhets(x, verbose = NULL)-- name of the genlight object containing the SNP data [required]
-- verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2]
The modified genlight object
utils.recalc.metrics for recalculating all metrics, utils.recalc.callrate for recalculating CallRate,
utils.recalc.freqhomref for recalculating frequency of homozygous reference, utils.recalc.freqhomsnp for recalculating frequency of homozygous alternate,
utils.recalc.AvgPIC for recalculating RepAvg, gl.recalc.maf for recalculating minor allele frequency,
gl.recalc.rdepth for recalculating average read depth
# NOT RUN {
#out <- utils.recalc.freqhets(testset.gl)
# }
Run the code above in your browser using DataLab