Code for running large-scale TWAS analyses and producing static Markdown reports. This repository contains scripts that compute TWAS statistics for many traits, merge and annotate them, produce reports, and generate an interactive web-site (see the jekyll directory). Note: for 324 traits, this analysis resulted in ~60,000 reports for a total of 2GB.
REPORT_*.R scripts use as input the following parameter files:
panels.par: Statistics on the gene expression reference panels used. If you're running with our pre-computed FUSION weights you can use the provided file.
all.models.par: Statistics on each of the predictive models, generated by the FUSION profiler script. If you're running with our pre-computed FUSION weights you can use the provided file.
traits.par: Information on each of the traits/TWAS studies performed. Important, the
OUTPUTcolumn must to point to the merged results from all chromosomes for that trait (see below).
mkdir genes traits tmp
TWAS.shjobs for each trait x chromosome in parallel (see example
MERGE.shto combine all files and generate info files
REPORT.shfor each trait (see example
Rscript REPORT_GENES.Rto scan through all traits and build individual gene reports (this takes a few hours)
Rscript REPORT_INDEX.Rto generate all index files (fast)
genes/, and all
*.mdfiles to the
jekyll/directory and then execute
jekyll buildto get the formatted web-site (or upload the directory to github-pages). See jekyll docs for more info.