View source: R/pairwise_king.R
| pairwise_king | R Documentation |
gen_tibble objectThis function computes the KING-robust estimator of kinship, reimplementing the KING algorithm of Manichaikul et al. (2010).
pairwise_king(
x,
as_matrix = FALSE,
block_size = bigstatsr::block_size(nrow(x))
)
x |
a |
as_matrix |
boolean, determining whether the results should be a square symmetrical matrix (TRUE), or a tidied tibble (FALSE, the default) |
block_size |
maximum number of loci read at once. More loci should improve speed, but will tax memory. |
a square symmetrical matrix of relationship coefficients between
individuals if as_matrix is TRUE, or a tidied tibble of coefficients if
as_matrix is FALSE.
Manichaikul, A. et al. (2010) Robust relationship inference in genome-wide association studies. Bioinformatics, 26(22), 2867–2873. https://doi.org/10.1093/bioinformatics/btq559.
Note that monomorphic sites are currently considered. Remove monomorphic sites before running pairwise_king if this is a concern.
example_gt <- load_example_gt("gen_tbl")
# Compute the KING-robust matrix
pairwise_king(example_gt, as_matrix = TRUE)
# Or return a tidy tibble
pairwise_king(example_gt, as_matrix = FALSE)
# Adjust block_size
pairwise_king(example_gt, block_size = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.