Section 2 Genetic prioritisation
2.1 Package installation
# if BiocManager not installed, please do so:
install.packages('BiocManager')
# then, install packages Pi and tidyverse
::install(c('Pi','tidyverse')) BiocManager
2.2 Do prioritisation
# load packages
library(Pi)
library(tidyverse)
<- "http://galahad.well.ox.ac.uk/bigdata"
RData.location
# read GWAS summary data
<- file.path(RData.location, "KSD_gwas_data.txt.gz")
data.file <- read_delim(data.file, delim='\t') %>% as.data.frame()
data
# pre-define parameters and built-in datasets
<- 'gskpn'
guid <- xRDataLoader('GWAS_LD', guid=guid)$EUR %>% xSM2DF()
LD.customised <- 5e-8
significance.threshold <- 2000
distance.max <- "constant"
decay.kernel <- xRDataLoader('dbSNP_GWAS', guid=guid)
GR.SNP <- xRDataLoader('UCSC_knownGene', guid=guid)
GR.Gene <- "GM12878" # lymphoblast, reflective of immune-context genomic
include.TAD <- c("Monocytes","Macrophages_M0","Macrophages_M1","Macrophages_M2","Neutrophils","Megakaryocytes","Endothelial_precursors","Erythroblasts","Fetal_thymus","Naive_CD4_T_cells","Total_CD4_T_cells","Activated_total_CD4_T_cells","Nonactivated_total_CD4_T_cells","Naive_CD8_T_cells","Total_CD8_T_cells","Naive_B_cells","Total_B_cells")
include.HiC <- c("Blood","CD14","CD4","CD8")
include.eQTL <- xDefineNet(network="STRING_high", STRING.only=c("experimental_score","database_score"), RData.location=RData.location) %>% dNetInduce(nodes_query=names(GR.Gene), knn=0, largest.comp=F)
network.customised
# prepare predictors
<- xPierSNPsAdvABF(data, LD.customised=LD.customised, significance.threshold=significance.threshold, distance.max=distance.max, decay.kernel=decay.kernel, decay.exponent=decay.exponent, GR.SNP=GR.SNP, GR.Gene=GR.Gene, include.TAD=include.TAD, include.HiC=include.HiC, include.eQTL=include.eQTL, network.customised=network.customised, RData.location=RData.location)
ls_pNode_genomic
# Prioritisation
<- Filter(Negate(is.null), ls_pNode_genomic)
ls_pNode <- xPierMatrix(ls_pNode, displayBy="pvalue", aggregateBy="fishers", RData.location=RData.location)
dTarget
# write into a file 'KSD_priority.txt.gz'
$priority %>% select(name,rank,rating,description) %>% write_delim('KSD_priority.txt.gz', delim='\t') dTarget
2.3 Prioritised genes
Target genes stored in the output file KSD_priority.txt.gz
above can be explored below. Notes, genes are ranked by priority rating (scored 0-5; see the column Rating
).