Center a relatedness matrix, after Zhou's GEMMA function CenterMatrix

center_kinship(mat)

Arguments

mat

a relatedness matrix

Value

a centered relatedness matrix

Examples

readr::read_tsv(system.file("extdata", "mouse100.cXX.txt", package = "gemma2"), col_names = FALSE)[, 1:100] -> kinship
#> #> ── Column specification ──────────────────────────────────────────────────────── #> cols( #> .default = col_double(), #> X101 = col_logical() #> ) #> Use `spec()` for the full column specifications.
e_out <- eigen2(as.matrix(kinship)) center_kinship(as.matrix(kinship)) -> kinship_centered