knitr::opts_chunk$set(echo = TRUE)

Exploring different Kinship structures

We are looking for a dataset (real or simulated) in which there is more of a population or family structure. I ran across the following two papers on bioarchiv which could be of interest:

  1. $F_{ST}$ and kinship for arbitrary population structures II: Method of moments estimators
  2. $F_{ST}$ and kinship for arbitrary population structures I: Generalized definitions

In those two papers and accompanying packages they explain and provide some algorithms to simulate more complex genotype data.

Simulate data

rm(list = ls())
pacman::p_load(gaston)
pacman::p_load(glmnet)
pacman::p_load(magrittr)
pacman::p_load(snpStats)
pacman::p_load_gh('StoreyLab/popkin')
pacman::p_load_gh('StoreyLab/bnpsd')
pacman::p_load(MASS)
devtools::load_all("~/git_repositories/ggmix/")
source("~/git_repositories/ggmix/simulation/model_functions.R")
dat <- make_INDmixed_model_not_simulator(n = 1000, p = 10000, ncausal = 100, k = 5, s = 0.5, Fst = 0.1,
                                         b0 = 1, beta_mean = 1,
                                         eta = 0.10, sigma2 = 4)
dat2 <- make_ADmixed_model_not_simulator(n = 1000, p = 10000, ncausal = 100, k = 5, s = 0.5, Fst = 0.1,
                                        b0 = 0, beta_mean = 1,
                                        eta = 0.10, sigma2 = 4)
popkin::plotPopkin(list(dat$kin, dat2$kin), titles = c("independent","mixed"))


sahirbhatnagar/ggmix documentation built on April 18, 2021, 3:46 p.m.