This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coloc.bayes.3t <- function(df1,snps=setdiff(colnames(df1),response),response="Y",priors=list(rep(1,14)),r2.trim=0.99,thr=0.005,quiet=TRUE) { | |
#we consider all models which contain at most 1 snp for each of the three traits | |
snps <- unique(snps) | |
n.orig <- length(snps) | |
if(n.orig<2) | |
return(1) | |
prep <- prepare.df(df1, snps, r2.trim=r2.trim, dataset=1, quiet=quiet) | |
df1 <- prep$df | |
snps <- prep$snps | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(nnet) | |
nsnp <- 3 | |
simdata <- function(n) { | |
X <- matrix(pmin(abs(rnorm(n*nsnp)),3),nrow=n) | |
p <- rbinom(n, 1, X[,1]/3) | |
q <- rbinom(n, 1, X[,nsnp]/3) | |
Y <- ifelse(p>0, 1, ifelse(q>0, 2, 0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggdendro) | |
library(ggplot2) | |
library(reshape) | |
library(grid) | |
library(gtable) | |
## colours, generated by | |
## library(RColorBrewer) | |
## rev(brewer.pal(11,name="RdYlBu")) | |
my.colours <- c("#313695", "#4575B4", "#74ADD1", "#ABD9E9", "#E0F3F8", "#FFFFBF", |
NewerOlder