# GTEx GWAS integration
This package contains the application of several GWAS-QTL integration methods.
The results were analyzed in [this preprint](https://www.biorxiv.org/content/10.1101/814350v1)
about GTEx v8 application to several GWAS traits.
```
.
|-- colocalization
| |-- coloc
| | `-- coloc_enloc_priors_eqtl.tar.gz
| |-- enloc
| | |-- enloc_eqtl_eur.tar.gz
| | `-- enloc_sqtl_eur.tar.gz
| `-- eur_ld.bed.gz
|-- prediction_models
| |-- gtex_v8_expression_mashr_snp_smultixcan_covariance.txt.gz
| |-- gtex_v8_splicing_mashr_snp_smultixcan_covariance.txt.gz
| |-- mashr_eqtl.tar
| `-- mashr_sqtl.tar
|-- smr
| |-- SMR_gtex_v8_README.txt
| `-- SMRresults_GTEx_v8_peQTL5e-08.tar.gz
|-- smultixcan
| |-- smultixcan_eqtl.tar.gz
| `-- smultixcan_sqtl.tar.gz
`-- spredixcan
|-- spredixcan_eqtl.tar.gz
`-- spredixcan_sqtl.tar.gz
```
You can uncompress gzipped tarball packages `*.tar.gz` in a UNIX command line with an instruction such as:
```bash
tar -xzvpf smultixcan_eqtl.tar.gz
```
, and the tar packages (`*.tar`) with an analogous instruction:
```bash
tar -xvpf mashr_eqtl.tar
```
## Preliminaries
**Finemapping** results are contained in a separate release due to size constraints.
GWAS summary statistics for 114 traits were harmonized and imputed to GTEx v8 variants with MAF>0.01 using only european samples.
(summary imputation software [here](https://github.com/hakyimlab/summary-gwas-imputation)).
Some of the following analyses used the full set of 114 traits,
while some focused only on 87 traits whose imputed associations showed no deflation
(the imputation algorithm is conservative, and studies with too few available variants have a depleted distribution of association p-values after imputation).
The harmonized and imputed GWAS summary statistics are contained in a separate release due to size constraints.
For completeness' sake, the imputed summary statistics look like:
```
variant_id panel_variant_id chromosome position effect_allele non_effect_allele current_build frequency sample_size zscore pvalue effect_size standard_error imputation_status n_cases
rs554008981 chr1_13550_G_A_b38 chr1 13550 A G hg38 0.017316017316017316 336474 -2.2919929353647097 0.021906050841240293 NA NA imputed NA
rs201055865 chr1_14671_G_C_b38 chr1 14671 C G hg38 0.012987012987012988 336474 -0.9559192804440632 0.33911301727494103 NA NA imputed NA
...
```
The GWAS were split in approximately independent LD regions (Berisa-Pickrell)/
GWAS regions are defined in `eur_ld.bed.gz` (note that a few of them are ill-defined in hg38 and where ignored; only completely defined regions were used).
## Colocalization
### Enloc
ENLOC ([see fotware here](https://github.com/xqwen/integrative))
was run for sQTLs and eQTLs using individuals of european ancestry and DAP-G QTL enrichment results on 87 traits.
Result files are included in `enloc_eqtl_eur.tar.gz` and `enloc_sqtl_eur.tar.gz`
Each file contains a particular tissue-trait combination.
Each row details colocalization between a GWAS region (Berisa-Pickrell) and gene's or intron's cis-window.
A region might overlap multiple genes/introns or viceversa.
Each ENLOC file contains the following columns:
* gwas_locus: GWAS LD region
* molecular_qtl_trait: gene or intron
* locus_gwas_pip: posterior inclusion probability of variants in the GWAS LD region
* locus_rcp: regional colocalization probability (main colocalization measure)
* lead_coloc_SNP: snp with highest RCP
* lead_snp_rcp: rcp of the lead coloc snp
### Coloc
Coloc ([see software here](https://cran.r-project.org/web/packages/coloc/index.html))
was run using prior probabilities estimated from QTL enrichment of GWAS variants (computed via ENLOC).
Results for eQTL are available in `coloc_enloc_priors_eqtl.tar.gz`.
Each file contains results for a trait-tissue combination. Columns are:
* gene_id: gene or intron id
* p0: probability that neither QTL nor GWAS contain a causal variant
* p1: probability that only GWAS contains a causal variant
* p2: probability that only QTL has a causal variant
* p3: probability that GWAS and QTL have a causal variant and it's distinct
* p4: probability that GWAS and QTL have a causal variant and it's the same (main colocalization measure)
## PrediXcan
`mashr_eqtl.tar` and `mashr_sqtl.tar` contain prediction models
(trained on expression or splicing data respectively, for 49 GTEx tissues) and LD compilations
to be used with PrediXcan, S-PrediXcan, MultiXcan and S-MultiXcan.
For every tissue, the `mashr_{tissue}.db` file is a SQLite file with the prediction model definitions.
`mashr_{tissue}.txt.gz` is a gzipped-text file with the upper triangular matrices of covariance between snps
within a gene/intron prediction model.
Many variants in these models don't have an rsid. To fully leverage the information in these models,
it is advised to at least harmonize to GTEx variants, and if possible impute as we did [here](https://github.com/hakyimlab/summary-gwas-imputation).
### S-PrediXcan
S-PrediXcan was run for the 114 harmonized and imputed traits, on eQTL and sQTL mashr prediction models.
All of the GWAS traits had the same format, so that the following format parameters were used with S-PrediXcan:
```
--snp_column panel_variant_id --effect_allele_column effect_allele --non_effect_allele_column non_effect_allele --zscore_column zscore \
--keep_non_rsid --additional_output --model_db_snp_key varID \
```
Each file is a CSV, with each row containing a gene/intron association at a given trait-tissue combination:
* gene: ENSEMBLE ID or intron id
* gene_name: HUGO name or intron id
* zscore: predicted association z-score
* effect_size: estimated effect size
* pvalue: association p-value
* var_g: estimated variance of predicted expression or splicing
* pred_perf_r2: prediction model cross-validated performance
* pred_perf_pval: prediction model cross-validated performance
* pred_perf_qval: deprecated, empty field left for compatibility
* n_snps_used: number of snps in the intersection of GWAS and model
* n_snps_in_cov: number of snps in the LD compilation
* n_snps_in_model: number of snps in the model
* best_gwas_p: smallest p-value acros GWAS snps used in this model
* largest_weight: largest prediction model weight
### S-Multixcan
S-MultiXcan results were generated from the above S-PrediXcan results. Each fiel contains multi-tissue associations for a given trait:
* gene: ENSEMBLE ID or intron id
* gene_name: HUGO name or intron id
* pvalue: multi-tissue association p-value
* n: number of models avialble for this gene/intron
* n_indep: number of independent components of variation in predicted expression/splicing (surviving principal components)
* p_i_best: highest single-tissue p-value (S-PrediXcan)
* t_i_best: tissue of highest p-value
* p_i_worst: lowest single-tissue p-value (S-PrediXcan)
* t_i_worst: tissue of lowest p-value
* eigen_max: maximum eigenvalue of SVD
* eigen_min: minimum eigenvalue of SVD
* eigen_min_kept: smallest eigenvalue retained after discarding smallest variations
* z_min: minimum single-tissue z-score
* z_max: maximum single-tissue z-score
* z_mean: mean single-tissue zscre
* z_sd: standard deviation of the single-tissue z-scores
* tmi: trace of M * M_i where M is predicted expression/splicing covariance across tissues for a gene, and M_i is its SVD pseudo-inverse
* status: computation status, 0 if no errors
## SMR
See `SMR_gtex_v8_README.txt` for details.