This repository contains R code to perform TreeWAS analysis and infer genetic risk profiles across UK Biobank phenotype data sets. For a description of the method see preprint [[https://www.biorxiv.org/content/early/2018/07/23/374207][here]].
library(TreeWASDir)
HES.data <- load.HES.lk.data() pars <- load.pars()
data <- HES.data$d res <- HES.data$res
snp <- "rs4420638" SNP.IDX <- which(res$SNP %in% snp)
lBF <- calc.lBF( pars = pars, data.sub = data[SNP.IDX,,] ) cat("The Tree BF is ",round(lBF,2), "\n")
pp <- marginal.posterior.profile( pars = pars, data.sub = data[SNP.IDX,,] )
treePlot <- drawTree( tree = pars$tree, pp = pp, tree_title = res[SNP.IDX,"SNP"], trim_tree_pp = 0.25 )
library(devtools)
install_github("mcveanlab/TreeWASDir")