View source: R/relatedness_mat.R
relatedness_mat | R Documentation |
Given a matrix of genotypes, this function estimates the genetic relatedness matrix (GRM, also known as the RRM, see Hayes et al. 2009, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1017/S0016672308009981")}) among the subjects: XX'/p, where X is standardized.
relatedness_mat(X, std = TRUE, fbm = FALSE, ns = NULL, ...)
X |
An n x p numeric matrix of genotypes (from fully-imputed data). Note: This matrix should not include non-genetic features. |
std |
Logical: should X be standardized? If you set this to FALSE (which can only be done if data are stored in memory), you should have a good reason for doing so, as standardization is a best practice. |
fbm |
Logical: is X stored as an FBM? Defaults to FALSE |
ns |
Optional vector of values indicating the indices of nonsingular features |
... |
Other optional arguments to |
An n x n numeric matrix capturing the genomic relatedness of the
samples represented in X
. In our notation, we call this matrix K for 'kinship';
this is also known as the GRM or RRM.
RRM <- relatedness_mat(X = admix$X)
RRM[1:5, 1:5]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.