Skip to content

mcveanlab/TreeWASDir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TreeWAS - Genetic risk profiles


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 here.

Demo

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)

## Calculate the evidence that the SNP is
## associated with at least one term in the
## ontology
lBF <- calc.lBF(
    pars       = pars,
    data.sub   = data[SNP.IDX,,]
)
cat("The Tree BF is ",round(lBF,2), "\n")

## Calculate the risk profile across the
## ontology
pp <- marginal.posterior.profile(
    pars       = pars,
    data.sub   = data[SNP.IDX,,]
)

## visualise the results. Return a plotly
treePlot <- drawTree(
    tree           = pars$tree,
    pp             = pp,
    tree_title     = res[SNP.IDX,"SNP"],
    trim_tree_pp   = 0.25
)

Install

library(devtools)

install_github("mcveanlab/TreeWASDir")

About

Repository for our manuscript 'Systematic classification of shared components of genetic risk for common human diseases'.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages