analyze_xwas_results

After running summary predixcan on different epigeneti marks and disease conditions, we can analyze the results to see if these marks help identify associations with disease.
Author

Saideep Gona

Published

June 7, 2024

Code
path_to_full_spredixcan_results = "/beagle3/haky/users/saideep/projects/aracena_modeling/SPrediXcan/sumstats_formatted/asthma_eczema_farreira_susie/enformer_preds/spredixcan/spredixcan_results_full.txt"

full_spredixcan_results = read.table(path_to_full_spredixcan_results, header = T, sep = "\t")
print(head(full_spredixcan_results))
                      gene                gene_name    zscore effect_size
1   chr6_32633491_32633493   chr6_32633491_32633493  9.547982   0.3284231
2  chr11_76582714_76582716  chr11_76582714_76582716 -9.299150  -1.7051217
3     chr2_8302118_8302120     chr2_8302118_8302120 -9.154066  -2.1869741
4 chr5_111066174_111066176 chr5_111066174_111066176 -8.733922  -2.8503919
5  chr16_11135271_11135273  chr16_11135271_11135273 -8.143531  -2.0940743
6   chr6_32616043_32616045   chr6_32616043_32616045  7.453646   0.5709822
        pvalue        var_g pred_perf_r2 pred_perf_pval pred_perf_qval
1 1.322473e-21 0.0191639060    0.9094893   0.000000e+00             NA
2 1.415723e-20 0.0005242785    0.7996330  1.155488e-195             NA
3 5.482984e-20 0.0003027743    0.9399288   0.000000e+00             NA
4 2.459898e-18 0.0001747785    0.8086730  9.366178e-205             NA
5 3.839157e-16 0.0002447562    0.8948331  7.096157e-307             NA
6 9.079548e-14 0.0041832651    0.8211055  1.661610e-213             NA
  n_snps_used n_snps_in_cov n_snps_in_model modality condition
1          91           129             129  H3K27ac       Flu
2         236           282             282  H3K27ac       Flu
3         137           175             175  H3K27ac       Flu
4         113           138             138  H3K27ac       Flu
5         215           267             267  H3K27ac       Flu
6         104           154             154  H3K27ac       Flu
Code
full_spredixcan_results$neglog10p = -log10(full_spredixcan_results$pvalue)
Code
library(ggplot2)

ggplot(full_spredixcan_results, aes(x=modality, y=gene, fill=pvalue)) + 
  geom_raster() + 
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1), # lables vertical
        strip.text.y = element_blank()) +  #remove facet bar on y 
  scale_fill_gradient(low = "darkblue", high = "lightblue") +
  ggtitle("test table") +
  facet_grid(cols = vars(full_spredixcan_results$condition), scales = "free", space="free_y") #facets to add gaps 

Code
library(ggplot2)

ggplot(full_spredixcan_results, aes(x=condition, y=gene, fill=pvalue)) + 
  geom_raster() + 
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1), # lables vertical
        strip.text.y = element_blank()) +  #remove facet bar on y 
  scale_fill_gradient(low = "darkblue", high = "lightblue") +
  ggtitle("test table") +
  facet_grid(cols = vars(full_spredixcan_results$modality), scales = "free", space="free_y") #facets to add gaps 

Code
ggplot(full_spredixcan_results, aes(x=modality, y=gene, fill=neglog10p)) + 
  geom_raster() + 
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1), # lables vertical
        strip.text.y = element_blank()) +  #remove facet bar on y 
  scale_fill_gradient(low = "darkblue", high = "lightblue") +
  ggtitle("test table") +
  facet_grid(cols = vars(full_spredixcan_results$condition), scales = "free", space="free_y") #facets to add gaps 

Code
ggplot(full_spredixcan_results, aes(x=condition, y=gene, fill=neglog10p)) + 
  geom_raster() + 
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1), # lables vertical
        strip.text.y = element_blank()) +  #remove facet bar on y 
  scale_fill_gradient(low = "darkblue", high = "lightblue") +
  ggtitle("test table") +
  facet_grid(cols = vars(full_spredixcan_results$modality), scales = "free", space="free_y") #facets to add gaps