knitr::opts_chunk$set(echo = TRUE,warning=FALSE) set.seed(1)
## Load packages library(devtools) library(dplyr) library(ggplot2) library(cowplot) library(xtable) devtools::load_all('.') # library('gws') library(moiR) # library(bigsnpr) # library(bigstatsr)
### high and low LD # Right now only the selected ones X<- get_topSNPs() X[1:5,1:5]
### sparse and gaussian ### additive and epistatic Yl<-list(sparse=list(add= simupheno(X,sparsity=0.95) ,epi=simupheno(X,sparsity=0.95,epistasis = 2) ), gaussian=list(add= simupheno(X,sparsity=0.5) ,epi=simupheno(X,sparsity=0.5,epistasis = 2) )) Yl
sa<-data.frame( true=Yl$sparse$add$eff, bgwa=gwa(X,Yl$sparse$add$Y), b=cgwa(X,Yl$sparse$add$Y), bridge=ridgegwa(X,Yl$sparse$add$Y,type='penalized'), blasso=lassogwa(X,Yl$sparse$add$Y) ) p1<-(ggdotscolor(sa$true,sa$bgwa, ylab='True effect',xlab='Inferred effect',color='grey70') %>% addggregression(se=F,lty='dashed') )+ggtitle("Marginal") p2<-(ggdotscolor(sa$true,sa$b, ylab='True effect',xlab='Inferred effect',color='grey70') %>% addggregression(se=F,lty='dashed') )+ggtitle("Conditional") p3<-(ggdotscolor(sa$true,sa$bridge, ylab='True effect',xlab='Inferred effect',color='grey70') %>% addggregression(se=F,lty='dashed') )+ggtitle("Ridge") p4<-(ggdotscolor(sa$true,sa$blasso, ylab='True effect',xlab='Inferred effect',color='grey70') %>% addggregression(se=F,lty='dashed') )+ggtitle("Lasso") plot_grid(p1,p2,p3,p4)
LDobs<-ldCnext(X,Yl$sparse$add$Y) %>% cleanld() hist(LDobs) res<-optim(par = c(1,sa$bridge), fn = ld.lik, y=LDobs, method="BFGS")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.