These web pages include a tutorial for using LDAK-KVIK on the UK Biobank Research Analysis Platform (UKB-RAP). We include a guide for preparing your data, example commands for running LDAK-KVIK, and recommendations for efficient use of the UKB-RAP. The recommendations listed on these pages also apply to other cloud-based computing facilities. Note that several of the recommendations listed here have also been described elsewhere.

The presented guide uses bash scripts that interact with the Swiss-Army-Knife, which sends command-line executables to the RAP server. However, it is also possible to perform these commands directly on the Cloud Workstation, which is also used in our YouTube tutorial. In this case, a virtual environment is set up in which you can download and analyse UKB data, and upload the results to your project afterwards.


Recommendations

There are several ways to optimise the use of LDAK-KVIK on the RAP, enabling faster and cheaper GWAS.

Swiss-Army-Knife

When performing analyses using LDAK that have larger computational demands (e.g., processing imputed data, running a GWAS on the full UK Biobank data set), we recommend using the Swiss-Army-Knife. This provides an easy way to run any LDAK command in the background in a Linux Virtual Machine.

Input genotype files

In general, we recommend running LDAK using .bed files. Although LDAK also accepts genotype data of .bgen format, this format requires more time to load in LDAK software and increases the computational demands for GWAS. Therefore, other genotype formats are preferably converted to .bed files prior to analysis. Although this means that genotype dosage data should be hardcalled, losing part of the genotype information, we find that this approach results in near identical GWAS results.

We recommend running LDAK-KVIK Step 1 using only directly genotyped SNPs, which are available in folder “/Bulk/Genotype Results/Genotype calls”. Although it is possible to include more SNPs (e.g., imputed SNPs), including these will significantly increase run time. Moreover, including more SNPs does not improve association analysis in Step 2, so we recommend restricting to directly genotyped SNPs.

Selecting the instance

The UKB-RAP has several instances available, each with a different number of cores, memory, storage, and cost. The costs of instances increase linearly with the resources requested; a list of available instances and their costs is available on the UKB-RAP website.

When running LDAK-KVIK Step 1, we recommend using instances mem1_ssd1_v2_x4 (4 CPUs, 8GiB memory), mem2_ssd1_v2_x2 (2 CPUs, 8GiB memory), mem2_ssd2_v2_x2 (2 CPUs, 8 GiB memory), or mem3_ssd1_v2_x2 (2 CPUs, 16 GiB memory). These instances fit computational requirements for LDAK-KVIK, including memory usage (approx. 10GB for the full UKB dataset) and parallelisation (highest efficiency on a small number of cores), at minimal costs.