View source: R/HapDipKinship.R
kinship | R Documentation |
Estimates kinships for all combinations of pairs of individuals.
kinship(genotypematrix, ploidy = NA, skipKIMGENS = F, KIMGENSThreshold = 0.1)
genotypematrix |
A matrix encoding genotypes with columns of individuals and rows of SNP sites. (0=homozygotic reference, 1=heterozygotic, 2=homozygotic alternative). |
ploidy |
A data frame with two columns. First column is id (same as column names of genotype matrix). Second column is ploidy (1 or 2). Guess ploidy if not provided. |
skipKIMGENS |
Binary variable for skipping KIMGENS kinship estimates or not. F if not provided. See 'Details.' |
KIMGENSThreshold |
A kinship threshold for defining "relatives" in KIMGENS kinship. 0.1 if not provided. See 'Details.' |
This functions takes two step: The first step use exKING-robust (including KING-robust (Manichaikul et al. 2010)) to estimate kinship between two diploids and kinship between a haploid and a diploid. The second step use individuals related to the two individuals of interest as "references" to estimate kinship. The median of kinships from relatives of either individuals are averaged to estimate the correct kinship Relatives are defined by if the kinship estimates from the first step are larger than KIMGENSThreshold. Skipping this step will skip haploid-haploid kinship estimate.
A data frame encoding kinship and IBS0 for every pair of individuals
Wang, Y-W and Ané, C. KIMGENS: A novel method to estimate kinship in organisms with mixed haploid diploid genetic systems robust to population structure. Bioinformatics 38(11):3044-3050.
ancestrygenomatrix<-PopulationSim(1000,c(0.05,0.15,0.25))
ancestry<-matrix(c(6,2,0.3,2,6,0.3),nrow=3)
pedgeno<-HapdipPedigreeSim(ancestrygenomatrix,pedigree[1:18,],ancestry)
kinship(pedgeno)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.