smcclatchy / mapping

Quantitative Trait Mapping Lesson
https://smcclatchy.github.io/mapping/
Other
6 stars 11 forks source link

line plot of permutations at 10, 100, and 1000 #16

Open smcclatchy opened 3 years ago

smcclatchy commented 3 years ago

showing spread of permutations

My permutation simulations.

thrs = rep(0, 100) for(i in 1:100) { tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 10) thrs[i] = quantile(tmp, probs = 0.95) }

thrs2 = rep(0, 100) for(i in 1:100) { tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 100) thrs2[i] = quantile(tmp, probs = 0.95) }

thrs3 = rep(0, 100) for(i in 1:100) { print(i) tmp = scan1perm(genoprobs = pr, pheno = iron$pheno[,'liver', drop = F], Xcovar = Xcovar, n_perm = 1000, cores = 4) thrs3[i] = quantile(tmp, probs = 0.95) }

data.frame(perm10 = thrs, perm100 = thrs2, perm1000 = thrs3) %>% pivot_longer(cols = everything()) %>% ggplot() + geom_density(aes(value, color = name), size = 1) + labs(title = 'Comparison of 0.05 threshold using 10 vs 100 permutation', x = 'LOD', color = 'Num. Perms')