$npx -y skills add GPTomics/bioSkills --skill transcriptome-wide-associationPerforms gene-level association from GWAS summary statistics via genetically predicted tissue expression using FUSION, PrediXcan, S-PrediXcan, S-MultiXcan, UTMOST, MOSTWAS, kTWAS, EpiXcan, TIGAR-V2, and probabilistic fine-mapping with FOCUS and MA-FOCUS. Use when running TWAS fro
| 1 | ## Version Compatibility |
| 2 | |
| 3 | Reference examples tested with: FUSION (head of `gusevlab/fusion_twas`, scripts dated 2023+), MetaXcan / S-PrediXcan / S-MultiXcan 0.7.5+ (`hakyimlab/MetaXcan`), PrediXcan model files from PredictDB (GTEx v8 elastic-net + MASHR), UTMOST (head of `Joker-Jerome/UTMOST`), pyfocus 0.8+ (`bogdanlab/focus`), MA-FOCUS (head of `mancusolab/ma-focus`), TIGAR-V2 (head of `yanglab-emory/TIGAR`), PLINK 1.9 + PLINK 2.0, R 4.3+, Python 3.9-3.11. |
| 4 | |
| 5 | Before using code patterns, verify installed versions match. If versions differ: |
| 6 | - R: `Rscript --version`; for FUSION scripts inspect `--help` flags directly in the source |
| 7 | - Python: `pip show pyfocus` (MetaXcan is git-cloned, not on PyPI) then `SPrediXcan.py --help`, `SMulTiXcan.py --help`, `focus finemap --help` |
| 8 | - CLI: `plink2 --version`; FUSION ships as R scripts not a binary |
| 9 | |
| 10 | If a script throws an error about an argument that has moved (e.g. `--gwas_file` vs `--gwas-file`) or a model database schema change, introspect the installed script with `--help` and adapt rather than retrying. PredictDB model file paths change with GTEx version; pin the version explicitly in scripts. |
| 11 | |
| 12 | # Transcriptome-Wide Association |
| 13 | |
| 14 | **"Find genes whose predicted tissue expression is associated with my GWAS trait"** -> Train SNP -> expression prediction models on a reference eQTL panel, apply the per-gene SNP weights to GWAS summary statistics or genotypes, and produce a gene-level Z-score equivalent to a weighted sum of SNP Z-scores. The output is a gene-by-tissue association, but TWAS is NOT direct evidence of causal mediation: an LD-tagged eQTL signal produces the same statistical association as a truly causal one, and the dominant failure modes are LD-induced false positives at gene-dense loci, tissue mis-specification, and ancestry mismatch between GWAS and prediction weights. |
| 15 | |
| 16 | - CLI (sumstat TWAS, R): `FUSION.assoc_test.R --sumstats g.sumstats --weights weights.pos --weights_dir wgt/ --ref_ld_chr 1KG/EUR. --chr 22 --out chr22.dat` |
| 17 | - CLI (S-PrediXcan, Python): `SPrediXcan.py --model_db_path gtex_v8.db --covariance gtex_v8.cov --gwas_file g.txt --output_file out.csv` |
| 18 | - CLI (S-MultiXcan joint): `SMulTiXcan.py --models_folder mashr_models/ --gwas_folder gwas/ --metaxcan_folder spredixcan_per_tissue/ --output joint.csv` |
| 19 | - CLI (UTMOST cross-tissue): joint test across tissues via UTMOST's per-tissue GBJ / GBJ2 step |
| 20 | - CLI (FOCUS fine-mapping): `focus finemap gwas.sumstats 1KG_EUR focus.db --chr 22 --p-threshold 5e-8 --out chr22.focus` |
| 21 | - CLI (MA-FOCUS multi-ancestry): `focus finemap` with colon-separated per-ancestry sumstats / LD / weights and hyphen-joined ancestry codes in `--locations` (e.g. `38:EUR-EAS-AFR`) |
| 22 | |
| 23 | TWAS, cis-eQTL MR, and coloc operate on overlapping evidence: TWAS asks "is the gene's predicted expression associated with the trait?"; cis-eQTL MR asks "does the eQTL effect on expression mediate the trait effect under IV assumptions?"; coloc asks "do the GWAS and eQTL share a causal variant?". Strong causal claims require triangulation, not single-method significance. |
| 24 | |
| 25 | ## Algorithmic Taxonomy |
| 26 | |
| 27 | | Tool | Model | Input | Output | Strength | Fails when | |
| 28 | |------|-------|-------|--------|----------|------------| |
| 29 | | FUSION (Gusev 2016 Nat Genet 48:245) | Weighted sum of SNP Z-scores; per-gene multi-model (BLUP, lasso, elnet, top1, bslmm) selected by cross-validation R^2 | GWAS sumstats + pre-computed weights (.pos + per-gene RData) | TWAS Z, p; conditional joint analysis | Mature, ENCODE-style, pre-trained weights for many tissues (GTEx, CMC, METSIM, YFS, NTR) | LD-induced false positives at gene-dense loci; needs ancestry-matched LD reference; weights are heritability-thresholded so low-h2 genes drop | |
| 30 | | PrediXcan (Gamazon 2015 Nat Genet 47:1091) | Elastic-net SNP -> expression prediction; individual-level genotypes | PLINK genotypes + GWAS phenotype + GTEx prediction DB | Per-gene association test with full regression machinery | Most flexible (allows covariates, interactions, binary outcomes); same TWAS interpretation | Requires individual-level data; biobank-scale compute | |
| 31 | | S-PrediXcan (Barbeira 2018 Nat Commun 9:1825) | Summary-statistic equivalent of PrediXcan; Z-score weighted sum analogous to FUSION | GWAS sumstats + Predic |