pairwise_grm | R Documentation |
gen_tibble
objectThis function computes the Genomic Relationship Matrix (GRM). This is estimated by computing the pairwise kinship coefficients (coancestries) between all pairs of individuals from a matrix of Allele Sharing following the approach of Weir and Goudet 2017 based on beta estimators).
pairwise_grm(
x,
allele_sharing_mat = NULL,
block_size = bigstatsr::block_size(nrow(x))
)
x |
a |
allele_sharing_mat |
optional, the matrix of Allele Sharing returned by
|
block_size |
the size of the blocks to use for the computation of the allele sharing matrix. |
The GRM is twice the coancestry matrix (e.g. as estimated by
hierfstat::beta.dosage()
with inb=FALSE
).
a matrix of GR between all pairs of individuals
example_gt <- load_example_gt("gen_tbl")
# Compute the GRM from the allele sharing matrix
example_gt %>% pairwise_grm()
# To calculate using a precomputed allele sharing matrix, use:
allele_sharing <- example_gt %>% pairwise_allele_sharing(as_matrix = TRUE)
example_gt %>% pairwise_grm(allele_sharing_mat = allele_sharing)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.