FOCUS/MA-FOCUS on Biowulf

FOCUS (Fine-mapping Of CaUsal gene Sets) is software to fine-map transcriptome-wide association study statistics at genomic risk regions. The software takes as input summary GWAS data along with eQTL weights and outputs a credible set of genes to explain observed genomic risk.

MA-FOCUS (Multi-Ancestry Fine-mapping Of CaUsal gene Sets) is an extension of FOCUS that leverages summary GWAS data with eQTL weights from multiple ancestries to increase the precision of credible sets for causal genes.

References:

Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program.
Sample session (user input in bold):

[user@biowulf]$ sinteractive --mem=4G
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144 ~]$ module load focus

[user@cn3144 ~]$ cp -r $FOCUS_TEST_DATA .

[user@cn3144 ~]$ cd FOCUS_TEST_DATA

[user@cn3144 ~]$ focus finemap EA_WBC_new_munged_chr22.tsv.gz \
                          1000GP3_EUR/1000G.EUR.QC.allelesAligned.22 \
                          ea_fusion_genoa.db \
                          --chr 22 \
                          --prior-prob "gencode38" \
                          --locations 38:EUR \
                          --out ./focus_result
===================================
             FOCUS v0.802
===================================
focus finemap
        EA_WBC_new_munged_chr22.tsv.gz
        1000GP3_EUR/1000G.EUR.QC.allelesAligned.22
        ea_fusion_genoa.db
        --chr 22
        --prior-prob gencode38
        --locations 38:EUR
        --out ./focus_result

Starting log...
[2024-07-19 14:56:52 - INFO] Detecting 1 populations for fine-mapping.
...
[2024-07-19 14:57:09 - INFO] Finished TWAS & fine-mapping. Thanks for using FOCUS, and have a nice day!

[user@cn3144 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226

[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g. focus.sh). For example:

#!/bin/bash
set -e
module load focus
focus finemap \
      input.chr22.tsv.gz \
      1000GP3/EUR/1000G.EUR.QC.allelesAligned.22 \
      ea_fusion_genoa.db \
      --chr 22 \
      --prior-prob gencode38 \
      --locations 38:EUR \
      --out focus_output

Submit this job using the Slurm sbatch command.

sbatch [--mem=#] focus.sh
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. focus.swarm). For example:

focus finemape input1.tsv.gz ... --out focus_out1
focus finemape input2.tsv.gz ... --out focus_out2
focus finemape input3.tsv.gz ... --out focus_out3
focus finemape input4.tsv.gz ... --out focus_out4

Replace ... above with appropriate options. Then submit this job using the swarm command.

swarm -f focus.swarm [-g #] --module focus
where
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
--module FOCUS Loads the FOCUS module for each subjob in the swarm