Quickdraws: building a docker image

Save this as Dockerfile in the working directory. Please note this has only be tried and tested on linux OS.

FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04

RUN apt update && apt install build-essential python3 python3-pip python3-dev -y

# Upgrade pip to ensure it's the latest version
RUN pip install --upgrade pip setuptools wheel
RUN pip install torch --index-url https://download.pytorch.org/whl/cu118
RUN pip install quickdraws

# Set the working directory inside the container
WORKDIR /app

Build the docker image:

docker build -t quickdraws .

Saving the docker image:

docker save quickdraws -o quickdraws.tar

Running the demo example using docker:

Load the example data from the quickdraws repository:

git clone https://github.com/PalamaraLab/quickdraws.git
cd quickdraws

Save the code to run GWAS on example data as docker_run_example.sh:

#!/bin/bash

cd /mnt

bed="example/example"
phenoFile="example/phenotypes.txt"
covarFile="example/covariates.txt"
kinship="example/example.kinship"
bgen="example/example.bgen"
sample="example/example.sample"

outDir="example/output"
mkdir -p ${outDir}

## step 0: generating HDF5 file from data (optional step)
convert-to-hdf5 \
   --out ${outDir}/master \
   --bed ${bed}  

## step 1: run model fitting (step 1) on genotypes and phenotypes
quickdraws-step-1 \
   --out ${outDir}/qd \
   --bed ${bed} \
   --phenoFile ${phenoFile} \
   --covarFile ${covarFile} \
   --kinship ${kinship} \
   --hdf5 ${outDir}/master.hdf5

# step 2: get association stats for SNPs in bgen file
quickdraws-step-2 \
    --out ${outDir}/qd \
    --bed ${bed} \
    --out_step1 ${outDir}/qd \
    --covarFile ${covarFile} \
    --unrel_sample_list example/unrelated_FID_IID.txt

quickdraws-step-2 \
    --out ${outDir}/qd_imputed \
    --bgen ${bgen} \
    --sample ${sample} \
    --out_step1 ${outDir}/qd \
    --calibrationFile ${outDir}/qd.calibration \
    --covarFile ${covarFile} \
    --unrel_sample_list example/unrelated_FID_IID.txt

Run the example on a CPU node with docker:

docker run  --security-opt seccomp=unconfined --rm --shm-size=16g -v ./:/mnt/ quickdraws bash docker_run_example.sh