Case study: CTSH xQTL and AD GWAS¶

This notebook documents the analysis of xQTL case study on a targeted gene, CTSH.

  • Section 0: Sanity check
  • Section 1: Fine-mapping for xQTL and GWAS
  • Section 2: Multi-context colocalization with Bellenguez 2022
  • Section 3: Refinement of colocalized loci with other AD GWAS
  • Section 4: Assessment of multi-context xQTL effect sizes
  • Section 5: Multi-context causal TWAS (including conventional TWAS and MR)
  • Section 6: Context specific multi-gene fine-mapping
  • Section 7: Epigenomic QTL and their target regions
  • Section 8: Context focused validation in other xQTL data
  • Section 9: Non-linear effects of xQTL
  • Section 10: in silico functional studies in iPSC model
  • Section 11: Functional annotations of selected loci
  • Section 12: Candidate loci as trans-xQTL

Overview¶

FunGen-xQTL resource contains 67 xQTL contexts as well as 9 AD GWAS fine-mapped genome-wide. The overarching goal for case studies is to use these resource to raise questions and learn more about gene targets of interest.

Overall, a case study consists of the following aspects:

  • Check the basic information of the gene
  • Check the existing xQTL and integrative analysis results, roughly including
    • Summary table for univariate fine-mapping
    • Marginal association results
    • Multi-gene and multi-context fine-mapping
    • Multi-context colocalization with AD GWAS
    • TWAS, MR and causal TWAS
    • Integration with epigenetic QTL
    • Quantile QTL
    • Interaction QTL
    • Validation:
      • Additional xQTL data in FunGen-xQTL
      • Additional AD GWAS data-set already generated by FunGen-xQTL
    • In silico functional studies
      • Additional iPSC data-sets
    • Functional annotations of variants, particularly in relevant cellular contexts
  • Creative thinking: generate hypothesis, search in literature, raise questions to discuss

Computing environment setup¶

Interactive analysis will be done on AWS cloud powered by MemVerge. Please contact Gao Wang to setup accounts for you to start the analysis.

Please follow instructions on https://wanggroup.org/productivity_tips/mmcloud-interactive to configure your computing environment. Here are some additional packages you need to install after the initial configuration, in order to perform these analysis:

in terminal with bash:

micromamba install -n r_libs r-pecotmr

in R:

install.packages('BEDMatrix')

How to Use This Notebook¶

  1. Before you start: Load functions from cb_plot.R and utilis.R, located at <xqtl-paper>/codes/. These functions and resources are packaged to streamline the analysis and ensure everything is as clean as possible. And also the codes for ColocBoost under path /data/colocalization/colocboost/R.
  2. Inside of this notebook, use sed -i or Ctrl+F to replace the gene CTSH with the gene you want to analyze.
  3. For detailed analysis in some sections, please refer to the corresponding analysis notebooks as indicated. These companion notebooks are available under this same folder. The rest of the tasks can be completed with a few lines of code, as demonstrated in this notebook.
  4. Similarly for the companion notebooks you should also use the sed -i or Ctrl+F replacing gene_name (CTSH in this case) with the gene you want to investigate.

While using this notebook, you may need to generate three intermediate files from Sections 1 and 2, which will be useful for downstream analysis:

  • a. Section 1:
    • Fine-mapping contexts that indicate shared signals with AD, CTSH_finemapping_contexts.rds. This can be used as input for Section 8 the multi-cohort validation step
    • A subset of the xQTL-AD table, Fungen_xQTL_allQTL.overlapped.gwas.export.CTSH.rds. This can be used as input for Section 12.
  • b. Section 2: A variant list showing colocalization in cohorts we analyzed with ColocBoost, CTSH_colocboost_res.rds. this can be used as input for Sections 7, 9, 10, and 12.

Section 0: Sanity check¶

Check the basic information of the gene¶

  • To gain a preliminary understanding of this gene’s expression—specifically, whether it is cell-specific—can help us quickly determine if our results are consistent with expectations.

Useful websites:

  1. check gene function, (immune) cell type specificity, tissue specifity, protein location: https://www.proteinatlas.org
  2. check gene position and structure: https://www.ncbi.nlm.nih.gov/gene/
  3. other collective information: https://www.genecards.org

Check the existing results which are inputs to this analysis¶

Check the existing results which are inputs to this analysis¶

In [1]:
# If an error occurs while sourcing scripts, it might be because your get() returned NULL. 
#Please restart the kernel or click the R kernel in the upper right corner to resolve the issue.
source('../../codes/cb_plot.R')
source('../../codes/utilis.R')

for(file in list.files("/data/colocalization/colocboost/R", pattern = ".R", full.names = T)){
          source(file)
        }
gene_name = 'CTSH'

dir.create(paste0('plots/', gene_name), recursive = T)
In [3]:
target_gene_info <- get_gene_info(gene_name = gene_name)
target_gene_info
$gene_info
A data.table: 1 x 14
region_id#chrstartendTSSLD_matrix_idLD_sumstats_idLD_sumstats_id_oldTADB_indexTADB_idgene_startgene_endsliding_windowsgene_name
<chr><chr><dbl><dbl><int><chr><chr><chr><chr><chr><int><int><chr><chr>
ENSG00000103811chr15778800008252000078949573chr15:77703385-79213579,chr15:79213579-82094856,chr15:82094856-8497376315_77703385-79213579,15_79213579-82094856,15_82094856-8497376315_77703385-79213579,15_79213579_82094856,15_82094856_84973763TADB_1142chr15_76894683_835264127894957478921058chr15:71199029-78926846,chr15:73202704-83526412,chr15:74639085-85571216,chr15:76894683-86330334,chr15:81298552-90655467CTSH
$target_LD_ids
A matrix: 1 x 3 of type chr
chr15:77703385-79213579chr15:79213579-82094856chr15:82094856-84973763
$target_sums_ids
A matrix: 1 x 3 of type chr
15_77703385-7921357915_79213579-8209485615_82094856-84973763
$gene_region
'chr15:77880000-82520000'
$target_TAD_ids
A matrix: 1 x 1 of type chr
chr15_76894683_83526412
In [4]:
gene_id = target_gene_info$gene_info$region_id
chrom = target_gene_info$gene_info$`#chr`
In [4]:
source('../../codes/utilis.R')
expression_in_rosmap_bulk(target_gene_info)
No description has been provided for this image

Section 1: Fine-mapping for xQTL and GWAS¶

see notebook

In [15]:
region_p
No description has been provided for this image

Bellenguez et al GWAS signals has many overlap with CS from other xQTL sources. This motivates us to look further. The figure above shows the ranges of CS to give us a loci level idea. Below, we show the variants in those CS, color-coding the variants that are shared between them in the same color. In particular, AD GWAS signals are also captured by a few xQTL data, although at this point we don't have formal statistical (colocalization) evidences for these observations yet.

In [17]:
pip_p
No description has been provided for this image

Section 2: Multi-context colocalization with Bellenguez 2022¶

This is done using ColocBoost. The most updated version of ColocBoost results are under path s3://statfungen/ftp_fgc_xqtl/analysis_result/ColocBoost/2024_9/

In [4]:
cb_res <- readRDS(paste0("/data/analysis_result/ColocBoost/2024_9/",gene_id,"_res.rds") )
In [4]:
cb_res <- readRDS(paste0("/data/analysis_result/ColocBoost/2024_9/",gene_id,"_res.rds") )
In [9]:
cb <- plot_cb(cb_res = cb_res, cex.pheno = 1.5, x.phen = -0.2)
No description has been provided for this image
In [10]:
pdf('plots/CTSH/sec2.colocboost_res.pdf', width = 10, height = 5)
replayPlot(cb$p)
dev.off()
pdf: 2
In [11]:
# colocalized variants
cb_res_table
A data.frame: 3 x 8
colocalized phenotypespurity# variantshighest VCPcolocalized indexcolocalized variantsmax_abs_z_variantcset_id
<chr><dbl><dbl><dbl><chr><chr><chr><chr>
Ast; Exc; Inh; DLPFC; AC; PCC; Monocyte; pQTL; AC_unproductive; DLPFC_unproductive; PCC_unproductive; AD_Bellenguez_20221.000000020.56208905895; 5905chr15:78942615:G:A; chr15:78944951:C:T chr15:78942615:G:A coloc_sets:Y2_Y4_Y5_Y6_Y7_Y8_Y9_Y10_Y11_Y13_Y15_Y16:CS3
DLPFC_unproductive; PCC_unproductive 0.998328020.68968855951; 5944chr15:78953549:G:A; chr15:78953123:G:A chr15:78953549:G:A coloc_sets:Y13_Y15:CS1
Ast; DLPFC; AC; PCC 0.962287120.78191706045; 6044chr15:78970799:T:TC; chr15:78970780:T:Gchr15:78970799:T:TCcoloc_sets:Y2_Y6_Y7_Y8:CS2
In [12]:
# effect sign for each coloc sets
get_effect_sign_csets(cb_res)
$`coloc_sets:Y2_Y4_Y5_Y6_Y7_Y8_Y9_Y10_Y11_Y13_Y15_Y16:CS3`
A data.frame: 2 x 13
variantsAstExcInhDLPFCACPCCMonocytepQTLAC_unproductiveDLPFC_unproductivePCC_unproductiveAD_Bellenguez_2022
<chr><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl><dbl>
chr15:78942615:G:Achr15:78942615:G:A-6.6276489.9327293.223098-10.16455-13.73221-8.476387-14.05948-16.812795.9485357.0391227.663185-4.522059
chr15:78944951:C:Tchr15:78944951:C:T-6.5976459.9630293.360427-10.15700-13.73079-8.476387-13.78699-16.812795.9542657.0225847.663185-4.664234
$`coloc_sets:Y13_Y15:CS1`
A data.frame: 2 x 3
variantsDLPFC_unproductivePCC_unproductive
<chr><dbl><dbl>
chr15:78953549:G:Achr15:78953549:G:A-7.997664-8.791889
chr15:78953123:G:Achr15:78953123:G:A-7.931648-8.737987
$`coloc_sets:Y2_Y6_Y7_Y8:CS2`
A data.frame: 2 x 5
variantsAstDLPFCACPCC
<chr><dbl><dbl><dbl><dbl>
chr15:78970799:T:TCchr15:78970799:T:TC8.58047312.092057.8626596.873574
chr15:78970780:T:Gchr15:78970780:T:G 8.53510412.075097.5410406.812202
In [13]:
# LD between coloc sets
get_between_purity_simple(cb_res, gene.name = gene_id, path = '/data/colocalization/QTL_data/eQTL/')
A matrix: 3 x 5 of type chr
coloc_csets_1coloc_csets_2min_abs_cormax_abs_cormedian_abs_cor
coloc_sets:Y2_Y4_Y5_Y6_Y7_Y8_Y9_Y10_Y11_Y13_Y15_Y16:CS3coloc_sets:Y13_Y15:CS1 0.536318981888972 0.540882548155626 0.538561434994915
coloc_sets:Y2_Y4_Y5_Y6_Y7_Y8_Y9_Y10_Y11_Y13_Y15_Y16:CS3coloc_sets:Y2_Y6_Y7_Y8:CS20.02453912247317220.04052681886813620.0326097212807046
coloc_sets:Y13_Y15:CS1 coloc_sets:Y2_Y6_Y7_Y8:CS20.180654233321276 0.190119170825354 0.185299420483055

Here, different colors refer to different 95% Colocalization Sets (CoS, a metric developed in ColocBoost indicating that there is 95% probabilty that this CoS captures a colocalization event). We only included ROSMAP data for this particular ColocBoost analysis. In this case, we observe cell specific eQTL, bulk sQTL colocalization on ROSMAP data with AD as two separate CoS, suggesting two putative causal signals. We did not detect colocalization with pQTL of statistical significance although from Section 1 there are some overlap with pQTL signals in fine-mapping CS, the overlapped variants in CS have small PIP.

Section 3: Refinement of colocalized loci with other AD GWAS¶

Here we refine the colocalization with other AD GWAS to iron out any heterogeniety between studies (heterogeniety can come from many sources), to get additional candidate loci from these more heterogenous sources as candidates to study.

In [14]:
AD_cohorts <- c('AD_Jansen_2021', 'AD_Bellenguez_EADB_2022', 'AD_Bellenguez_EADI_2022',
             'AD_Kunkle_Stage1_2019', 'AD_Wightman_Excluding23andMe_2021',
             'AD_Wightman_ExcludingUKBand23andME_2021', 'AD_Wightman_Full_2021')
cb_ad <- plot_cb(cb_res = cb_res, cex.pheno = 1.5, x.phen = -0.2, add_gwas = TRUE, gene_id = gene_id, cohorts = AD_cohorts)
No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.
No description has been provided for this image
In [15]:
pdf('plots/CTSH/sec3.colocboost_res_allad.pdf', width = 10, height = 5)
replayPlot(cb_ad$p)
dev.off()
pdf: 2

Section 4: Assessment of multi-context xQTL effect sizes¶

Option 1: ColocBoost + MASH¶

Use colocboost variants and check for mash posterior contrast to see if the effect size are shared or specific or even opposite. Advantage is that colocboost result is AD GWAS informed; issue is that marginal posterior effects is not always the joint

In [16]:
mash_p <- mash_plot(gene_name = 'CTSH')

options(repr.plot.width = 10, repr.plot.height = 10)

for (mash_p_tmp in mash_p) {
    print(mash_p_tmp)
}

Option 2: mvSuSiE¶

Use mvSuSiE multicontext fine-mapping results --- the bubble plot to check posterior effects. Issue is that we don't have this results yet, and this is limited to one cohort at a time, without information from AD.

We should go for option 1 by default and if we want to make claim about opposite effect size we double-check with mvSuSiE multicontext analysis.

In [5]:
message("Multi context in ROSMAP data")

multi_context_rosmap_tmp <- tryCatch(
    readRDS(paste0('/data/analysis_result/multi_context/ROSMAP/mnm/ROSMAP_DeJager.',
                   target_gene_info$gene_info$`#chr`, '_', gene_id, '.multicontext_bvsr.rds')),
    error = function(e) message('Error in loading ROSMAP multi context data')
)
if (!is.null(multi_context_rosmap_tmp[[1]]$mvsusie_fitted)) {
    plot_and_save(multi_context_rosmap_tmp[[1]], 'plots/CTSH/sec4.multi_context_ROSMAP')
} else {
    message('Multi Context results are empty in ROSMAP data')
}
No description has been provided for this image
No description has been provided for this image
In [6]:
# Load and process MSBB data
message("Multi context in MSBB data")

multi_context_msbb_tmp <- tryCatch(
    readRDS(paste0('/data/analysis_result/multi_context/MSBB/mnm/MSBB_eQTL.',
                   target_gene_info$gene_info$`#chr`, '_', gene_id, '.multicontext_bvsr.rds')),
    error = function(e)  message('Error in loading MSBB multi context data')
)
if (!is.null(multi_context_msbb_tmp[[1]]$mvsusie_fitted)) {
    plot_and_save(multi_context_msbb_tmp[[1]], 'plots/CTSH/sec4.multi_context_MSBB')
} else {
    message('Multi Context results are empty in MSBB data')
}
No description has been provided for this image
No description has been provided for this image

Section 5: Multi-context causal TWAS (including conventional TWAS and MR)¶

The most updated version of cTWAS analysis are under path s3://statfungen/ftp_fgc_xqtl/analysis_result/cTWAS/

TWAS results¶

We report TWAS from all contexts and methods from the pipeline. Here we will filter it down to the best performing methods and only keep contexts that are significant.

In [17]:
plot_TWAS_res(gene_id = gene_id, gene_name = gene_name)
No description has been provided for this image

MR results¶

This is only available for genes that are deemed significant in TWAS and have summary statistics available for effect size and standard errors in GWAS, in addition to z-scores --- current version does not support z-scores although we will soon also support z-scores in MR using MAF from reference panel.

cTWAS results¶

To be updated soon.

Section 6: Context specific multi-gene fine-mapping¶

A quick analysis: using the xQTL-AD summary table (flatten table)¶

We extract from xQTL-AD summary table the variants to get other genes also have CS with the variants shared by target gene and AD.

In [18]:
multigene_flat <- get_multigene_multicontext_flatten('Fungen_xQTL_allQTL.overlapped.gwas.export.CTSH.rds', sQTL = 'no_MSBB')
multigene_flat
A data.frame: 43 x 6
gene_id#chrstartendgene_namecontexts
<chr><chr><int><int><chr><chr>
ENSG00000041357chr157854040478540405PSMA4 BM_22_MSBB_eQTL,Exc_mega_eQTL
ENSG00000058335chr157909077979090780RASGRF1 MiGA_GTS_eQTL,DLPFC_Bennett_pQTL,ROSMAP_AC_sQTL,ROSMAP_PCC_sQTL,STARNET_eQTL
ENSG00000080644chr157862129478621295CHRNA3 MiGA_GTS_eQTL,MiGA_SVZ_eQTL
ENSG00000103723chr158270994582709946AP3B2 MiGA_GTS_eQTL,ROSMAP_DLPFC_sQTL
ENSG00000103740chr157824568778245688ACSBG1 MiGA_GTS_eQTL,ROSMAP_AC_sQTL,ROSMAP_DLPFC_sQTL
ENSG00000103876chr158015248980152490FAH MiGA_THA_eQTL,MSBB_BM36_pQTL,DLPFC_Bennett_pQTL,ROSMAP_AC_sQTL,ROSMAP_PCC_sQTL
ENSG00000103888chr158077934280779343CEMIP MiGA_SVZ_eQTL,Exc_DeJager_eQTL,DLPFC_DeJager_eQTL,Exc_Kellis_eQTL,ROSMAP_AC_sQTL,ROSMAP_PCC_sQTL,ROSMAP_DLPFC_sQTL
ENSG00000103942chr158298615282986153HOMER2 BM_36_MSBB_eQTL
ENSG00000117899chr158098982780989828MESD ROSMAP_DLPFC_sQTL
ENSG00000117906chr157693173776931738RCN2 BM_22_MSBB_eQTL
ENSG00000136371chr157989737879897379MTHFS Exc_mega_eQTL,STARNET_eQTL
ENSG00000136378chr157881146378811464ADAMTS7 ROSMAP_AC_sQTL
ENSG00000136379chr158067968380679684ABHD17C MiGA_SVZ_eQTL,Ast_DeJager_eQTL,DLPFC_DeJager_eQTL,AC_DeJager_eQTL,Ast_mega_eQTL,ROSMAP_DLPFC_sQTL,ROSMAP_PCC_sQTL
ENSG00000136381chr157843743078437431IREB2 MiGA_SVZ_eQTL,MiGA_THA_eQTL,ROSMAP_PCC_sQTL,STARNET_eQTL
ENSG00000140379chr157997119579971196BCL2A1 MiGA_GTS_eQTL
ENSG00000140395chr157829963578299636WDR61 ROSMAP_PCC_sQTL,ROSMAP_DLPFC_sQTL
ENSG00000140403chr157826408578264086DNAJA4 MiGA_GTS_eQTL,BM_36_MSBB_eQTL,Inh_mega_eQTL,ROSMAP_AC_sQTL,STARNET_eQTL
ENSG00000140406chr158100092281000923TLNRD1 BM_22_MSBB_eQTL
ENSG00000140598chr158226273382262734EFL1 ROSMAP_PCC_sQTL
ENSG00000156206chr158100703281007033CFAP161 MiGA_GTS_eQTL
ENSG00000156218chr158365408783654088ADAMTSL3 ROSMAP_PCC_sQTL
ENSG00000166411chr157813149778131498IDH3A Knight_eQTL,MiGA_SVZ_eQTL,MiGA_THA_eQTL,ROSMAP_PCC_sQTL
ENSG00000166426chr157834035278340353CRABP1 MiGA_THA_eQTL,BM_36_MSBB_eQTL
ENSG00000167202chr157807772378077724TBC1D2B MiGA_SVZ_eQTL,Exc_Kellis_eQTL,ROSMAP_PCC_sQTL
ENSG00000169609chr158301164083011641C15orf40 ROSMAP_AC_sQTL
ENSG00000169684chr157856551978565520CHRNA5 MiGA_GTS_eQTL,MiGA_THA_eQTL,ROSMAP_PCC_sQTL
ENSG00000172345chr158132418281324183STARD5 MiGA_SVZ_eQTL,MiGA_THA_eQTL,DLPFC_DeJager_eQTL,PCC_DeJager_eQTL,AC_DeJager_eQTL
ENSG00000172349chr158115957481159575IL16 ROSMAP_AC_sQTL,ROSMAP_PCC_sQTL,ROSMAP_DLPFC_sQTL
ENSG00000172379chr158040438180404382ARNT2 ROSMAP_PCC_sQTL,ROSMAP_DLPFC_sQTL
ENSG00000173517chr157742014377420144PEAK1 MiGA_SVZ_eQTL
ENSG00000180953chr157992370179923702ST20 BM_44_MSBB_eQTL,PCC_DeJager_eQTL,AC_DeJager_eQTL,ROSMAP_AC_sQTL,ROSMAP_DLPFC_sQTL,STARNET_eQTL
ENSG00000182774chr158254045882540459RPS17 MiGA_GTS_eQTL,PCC_DeJager_eQTL
ENSG00000183476chr157807780778077808SH2D7 MiGA_GTS_eQTL
ENSG00000183496chr158204611882046119MEX3B MiGA_THA_eQTL
ENSG00000185787chr157881048678810487MORF4L1 MSBB_BM36_pQTL,ROSMAP_AC_sQTL,ROSMAP_PCC_sQTL,STARNET_eQTL
ENSG00000186628chr158280606982806070FSD2 MiGA_SVZ_eQTL
ENSG00000188266chr157850756378507564HYKK MiGA_THA_eQTL
ENSG00000188659chr158226280982262810SAXO2 Knight_eQTL,MiGA_GTS_eQTL,MiGA_SVZ_eQTL,MiGA_THA_eQTL,BM_10_MSBB_eQTL,BM_22_MSBB_eQTL,BM_36_MSBB_eQTL,BM_44_MSBB_eQTL,Oli_DeJager_eQTL,Exc_DeJager_eQTL,Inh_DeJager_eQTL,DLPFC_DeJager_eQTL,PCC_DeJager_eQTL,AC_DeJager_eQTL,Oli_Kellis_eQTL,monocyte_ROSMAP_eQTL,ROSMAP_DLPFC_sQTL
ENSG00000197978chr158243001982430020GOLGA6L9 MiGA_GTS_eQTL,DLPFC_DeJager_eQTL,Exc_Kellis_eQTL,ROSMAP_AC_sQTL
ENSG00000214575chr158264886082648861CPEB1 ROSMAP_PCC_sQTL
ENSG00000259332chr157992375379923754ST20-MTHFSROSMAP_AC_sQTL,ROSMAP_DLPFC_sQTL,ROSMAP_PCC_sQTL
ENSG00000259417chr158025221280252213CTXND1 MiGA_GTS_eQTL,MiGA_THA_eQTL,ROSMAP_PCC_sQTL
ENSG00000278662chr158234947482349475GOLGA6L10 MiGA_SVZ_eQTL,MiGA_THA_eQTL,DLPFC_DeJager_eQTL,ROSMAP_DLPFC_sQTL

Other genes implicated are PROC and HS6ST1 in MiGA cohort which may share causal eQTL with CTSH. Further look into the data-set --- using these genes as targets and repeating what we did above for CTSH --- might be needed to establish a more certain conclusion.

Alternatively, we may be able to apply a multi-gene statistical fine-mapping test on CTSH region to find these genes, as you will see in the section below.

A statistically solid approach: mvSuSiE multi-gene analysis¶

This multi-gene fine-mapping analysis was done for each xQTL context separately. We will need to check the results for all contexts where this gene has an xQTL, in order to identify if there are other genes also sharing the same xQTL with this target gene. We included other genes in the same TAD window along with this gene, and extended it into a sliding window approach to include multiple TADs just in case. You need to check the sliding windows belongs to that gene (TSS) on analysis repo.

In [7]:
sliding_windows <- target_gene_info$gene_info$TADB_id %>% strsplit(., ',') %>% unlist %>% as.character
sliding_windows
'chr15_76894683_83526412'
In [13]:
target_gene_info$gene_info$region_id
'ENSG00000103811'
In [12]:
mnm_gene_tmp <- readRDS('/data/analysis_result/multi_gene/ROSMAP/mnm_genes//ROSMAP_AC_DeJager_eQTL.chr15_76894683_83526412.multigene_bvrs.rds')
mnm_gene_tmp[[1]]$mvsusie_fitted$condition_names
  1. 'ENSG00000140386'
  2. 'ENSG00000117906'
  3. 'ENSG00000173517'
  4. 'ENSG00000140382'
  5. 'ENSG00000136425'
  6. 'ENSG00000166411'
  7. 'ENSG00000103740'
  8. 'ENSG00000136381'
  9. 'ENSG00000188266'
  10. 'ENSG00000169684'
  11. 'ENSG00000080644'
  12. 'ENSG00000117971'
  13. 'ENSG00000117899'
  14. 'ENSG00000136371'
  15. 'ENSG00000140406'
  16. 'ENSG00000156206'
  17. 'ENSG00000166557'
  18. 'ENSG00000259332'
  19. 'ENSG00000140598'
  20. 'ENSG00000188659'
  21. 'ENSG00000197978'
  22. 'ENSG00000278662'
  23. 'ENSG00000182774'
  24. 'ENSG00000260836'
  25. 'ENSG00000103942'
  26. 'ENSG00000169612'
  27. 'ENSG00000169609'
In [11]:
# Main loop to process sliding windows
mnm_gene <- list()
for (window in sliding_windows) {
    context_files <- list.files('/data/analysis_result/multi_gene/ROSMAP/mnm_genes/', window, full.names = T) %>% .[str_detect(., '.multigene_bvrs.rds')]
    for(context_file in context_files){
        context_mnm = context_file %>% basename %>% str_split(., '[.]', simplify = T) %>% .[,1]
        # Load multi-gene data
        mnm_gene_tmp <- tryCatch(
            readRDS(context_file),
            error = function(e) NULL
        )
        
        if (!is.null(mnm_gene_tmp)) {
            # Check if target gene is in the condition names
            if (target_gene_info$gene_info$region_id %in% mnm_gene_tmp[[1]]$mvsusie_fitted$condition_names) {
                # Use a common prefix format for multi-gene plots
                plot_and_save(mnm_gene_tmp[[1]], 'plots/JAZF1/sec6.multigene')
            } else {
                message('There is mnm result for TAD window ', window, ' in ', context_file,
                        ', but it does not include target gene ', gene_name, ' in CS.')
            }
            # Append to the results list
            mnm_gene <- append(mnm_gene, list(mnm_gene_tmp))
        } 
    }
}

In this case, there is no statistical evidence for CTSH sharing any of its xQTL with other genes in ROSMAP Microglia data we looked into; although we have not analyzed MiGA this way yet (which showed some potential signals from the quick analysis above).

Section 7: Epigenomic QTL and their target regions¶

fsusie, see notebook

Generate a crude plot to determined whether the story is interesting¶

This is a crude version of the case study plot which shows the fsusie Effect (colored line), the gene body (black arrow), the epi-QTL (large dots with the same color as the effects) and ADGWAS cs position (small red dots).

Only produce the refine plot if we can see either:

  1. There are sharing snp between epi-QTL and AD CS
  2. There are the AD CS located within one of the effect range
  3. The crude plot suggest something interesting
In [9]:
options(repr.plot.width = 40, repr.plot.height = 40)

 ggplot() + theme_bw() + facet_grid(cs_coverage_0.95 + study + region ~ ., labeller = labeller(.rows = function(x) gsub("([_:,-])", "\n", x)), scale = "free_y") +

      theme(text = element_text(size = 20), strip.text.y = element_text(size = 25, angle = 0.5)) +
     # xlim(view_win) +
      ylab("Estimated effect") +
   #   geom_line(data = haQTL_df %>% mutate(study = "haQTL effect") %>% filter(CS == 5),
    #            aes_string(y = "fun_plot", x = "x", col = "CS"), size = 4, col = "#00AEEF") +
  geom_line(data = effect_of_interest ,
                aes_string(y = "fun_plot", x = "x", col = "cs_coverage_0.95"), size = 2) +  
    geom_point(data = effect_of_interest ,
                aes_string(y = "pip", x = "pos", col = "cs_coverage_0.95"), size = 10) +
    theme(text = element_text(size = 40), strip.text.y = element_text(size = 15, angle = 0.5), 
            axis.text.x = element_text(size = 40), axis.title.x = element_text(size = 40)) +
      xlab("Position") +
      ylab("Estimated\neffect") +
      geom_segment(arrow = arrow(length = unit(1, "cm")), aes(x = gene_start, xend = gene_end, y = 1, yend = 1), size = 6,
                  data = tar_gene_info$gene_info, alpha = 0.3) +
      geom_text(aes(x = (gene_start + gene_end) / 2, y = 1 , label = gene_name), size = 10, 
              data = tar_gene_info$gene_info)+
        geom_point(aes(x = pos, y = pip  ) ,color = "red", data = flatten_table%>%filter( str_detect(study,"AD_") , cs_coverage_0.95 != 0  )%>%mutate(AD_study = study%>%str_replace_all("_","\n" ))%>%select(-study,-region,-cs_coverage_0.95) ) 
No description has been provided for this image

Section 8: Context focused validation in other xQTL data¶

see notebook

add fake version for now, so you don't have to refer to above link

Background: our "discovery set" is ROSMAP but we have additional "validation" sets including:

  • STARNET
  • MiGA
  • KnightADRC
  • MSBB
  • metaBrain
  • UKB pQTL

TODO:

  • Get from Carlos WashU CSF based resource (pQTL and metabolomic QTL)

This section shows verification of findings from these data-sets. In principle we should check them through sections 1-6 more formally. In practice we will start with colocalization via colocboost --- since our study is genetics (variant and loci level) focused. We can selectively follow them up for potentially intereting validations. We therefore only demonstrate validation via colocboost as a starting point.

In [5]:
finempping_contexts <- readRDS(paste0(gene_name, '_finemapping_contexts.rds')) # from sec1
In [5]:
finempping_contexts <- readRDS(paste0(gene_name, '_finemapping_contexts.rds')) # from sec1
In [6]:
finempping_contexts <- get_norosmap_contexts(finempping_contexts)
In [7]:
cb_contexts <- plot_cb(cb_res = cb_res, cex.pheno = 1.5, x.phen = -0.2, add_QTL = TRUE, cohorts = finempping_contexts, gene_id = gene_id)
No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.No pvalue cutoff. Extract all variants names.
No description has been provided for this image

Section 9: Non-linear effects of xQTL¶

see notebook

APOE interaction¶

In [10]:
options(repr.plot.width=6, repr.plot.height=6)

ggplot(CTSH_int_res, aes(x = variant_id, y = qvalue_interaction)) +
  geom_point(alpha = 0.7, size = 6) +
  labs(title = "qvalue for CTSH csets in interaction association nalysis",
       x = "Gene Name",
       y = "qvalue_interaction",
       size = "qvalue_interaction") +
  theme_minimal(base_size = 14) +
  theme(panel.background = element_blank(),
        panel.grid.major = element_line(color = "grey80"),
        legend.position = NULL,
        axis.text.x = element_text(angle = 45, hjust = 1))  + ylim(0,1)
  # scale_color_manual(values = colorRampPalette(brewer.pal(8, "Set1"))(length(unique(flat_var$gene_name))))
ggsave('plots/CTSH/sec11.interaction_association_CTSH_lessPIP25.pdf', height = 5, width = 8) 
No description has been provided for this image

In conclusion, there is no interaction QTL with APOE identified.

Quantile QTL analysis¶

Anjing will soon provide the vignette to assess that.

In [22]:
quant_coef_colocvar
No description has been provided for this image

Section 10: in silico functional studies in iPSC model¶

see notebook

In [11]:
vars_p
No description has been provided for this image
In [13]:
apoe_p
No description has been provided for this image

Section 11: Functional annotations of selected loci¶

see notebook

TODO

  • Touch base with Ryan on the snATAC annotations
  • Run this by Pavel to see if there are additional comments on how we do this
In [ ]:
 

Section 12: Candidate loci as trans-xQTL¶

see notebook

In [9]:
options(repr.plot.width=12, repr.plot.height=6)
if(!is.null(flat_var)){
   p =  ggplot(flat_var, aes(x = gene_name, y = pip, size = pip)) +
      geom_point(alpha = 0.7) +
      labs(title = paste0("PIP values for trans fine mapped Genes in ", gene_name ," csets with AD"),
           x = "Gene Name",
           y = "PIP",
           size = "PIP",
           color = "CS Coverage 0.95 Min Corr") +
      theme_minimal(base_size = 14) +
      theme(panel.background = element_blank(),
            panel.grid.major = element_line(color = "grey80"),
            legend.position = NULL,
            axis.text.x = element_text(angle = 45, hjust = 1))  
      # scale_color_manual(values = colorRampPalette(brewer.pal(8, "Set1"))(length(unique(flat_var$gene_name))))
    ggsave(paste0('plots/CTSH/sec12.trans_fine_mapping_',gene_name,'.pdf'),p, height = 5, width = 8)
    p
    } else{
    message('There are no detectable trans signals for ', gene_name)
}

Creative thinking: generate hypothesis, search in literature, raise questions to discuss¶

You can now generate some preliminary hypotheses based on the above results. Next, you should search for evidence in the literature to support or refine these hypotheses and identify additional analyses needed to confirm them.