View source: R/utils.fbm.export.r
| utils.fbm.grm | R Documentation |
WARNING: UTILITY SCRIPTS ARE FOR INTERNAL USE ONLY AND SHOULD NOT BE USED BY END USERS AS THEIR USE OUT OF CONTEXT COULD LEAD TO UNPREDICTABLE OUTCOMES.
Computes the realized additive relationship matrix of
rrBLUP::A.mat(as.matrix(x) - 1, min.MAF, max.missing) with A.mat's
default mean imputation and no shrinkage (Endelman & Jannink 2012;
VanRaden 2008), reading the genotypes in two passes over blocks of loci,
so the genotype matrix is never decoded as a whole.
As in A.mat, with genotypes g (0, 1, 2) and X = g - 1: per locus
the frequency p is mean(g, na.rm = TRUE) / 2 (computed per column
exactly as A.mat computes it) and the missing fraction is the share of
NA. Loci with min(p, 1 - p) >= min.MAF and missing fraction
<= max.missing are used (m loci). W = g - 2p, with missing
genotypes set to 0 (mean imputation) and loci fixed in the sample set to
0, and A = tcrossprod(W) / (2 * mean(p * (1 - p))) / m, where the
mean is over the m loci.
The frequencies, filter and scaling are identical to A.mat; the cross-product is added block by block, so A agrees with A.mat to about 1e-13 (relative) rather than bit for bit. Memory: the n x n result and one block of loci.
utils.fbm.grm(x, min.MAF = NULL, max.missing = NULL)
x |
A file-backed dartR object (diploid SNP) [required]. |
min.MAF |
Minimum minor allele frequency [default 1/(2n), as A.mat]. |
max.missing |
Maximum missing fraction of a locus [default 1 - 1/(2n), as A.mat]. |
An n x n matrix with indNames(x) as row and column names.
Custodian: Bernd Gruber – Post to https://groups.google.com/d/forum/dartr
Endelman, J.B. and Jannink, J.-L. (2012) Shrinkage estimation of the realized relationship matrix. G3 2:1405-1413.
Other utilities:
gl.He(),
gl.Ho(),
gl.alf(),
utils.allelic.richness(),
utils.basic.stats(),
utils.check.datatype(),
utils.collapse.matrix(),
utils.dart2genlight(),
utils.dist.binary(),
utils.fbm.amat(),
utils.fbm.blocks(),
utils.fbm.colblocks(),
utils.fbm.colwise(),
utils.fbm.copy(),
utils.fbm.count.mean(),
utils.fbm.decode(),
utils.fbm.has(),
utils.fbm.new(),
utils.fbm.pair.counts(),
utils.fbm.reader(),
utils.fbm.rowwise(),
utils.fbm.tempfile(),
utils.flag.start(),
utils.het.pop(),
utils.history.call(),
utils.is.fixed(),
utils.jackknife(),
utils.n.var.invariant(),
utils.plot.save(),
utils.read.fasta(),
utils.read.ped(),
utils.recalc.avgpic(),
utils.recalc.callrate(),
utils.recalc.freqhets(),
utils.recalc.freqhomref(),
utils.recalc.freqhomsnp(),
utils.recalc.maf(),
utils.reset.flags(),
utils.transpose(),
utils.vcf.depth(),
utils.vcfr2genlight.polyploid()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.