pvdiv_kinship.Rd
Calculate the kinship matrix using code from GAPIT and bigsnpr and the methods of VanRaden (2009, J. Dairy Sci. 91:4414???C4423). Note that this matrix cannot currently be used with the GWAS methods in bigsnpr; however, this matrix could be used with other GWAS programs.
pvdiv_kinship(snp, ind.row = NA, hasInbred = TRUE, saveoutput = FALSE)
A "bigSNP" object; load with bigsnpr::snp_attach().
An integer vector of the rows (individuals) to find a kinship matrix for. Defaults to all rows.
Logical. Does the SNP file contain inbred individuals or closely related individuals, like siblings?
Logical. Should the output be saved to the working directory?
A kinship matrix with labeled rows and columns.
snpfile <- system.file("extdata", "example_bigsnp.rds", package = "switchgrassGWAS")
library(bigsnpr)
snp <- snp_attach(snpfile)
K <- pvdiv_kinship(snp = snp, saveoutput = FALSE)
#> 'saveoutput' is FALSE, so the kinship matrix will not be saved to the working directory.