LDAK includes an approximate version of GCTA-LOCO that can be substantially faster than the original version (which is available within the GCTA software). For example, we found that to analyse human data for 63k individuals and 690k SNPs, our version of GCTA-LOCO took 2.5 CPU hours, whereas the original version took about 488 CPU hours.
Here we explain how to run the our version of GCTA-LOCO. Note that this is a two-step process: the first step constructs the PRS, while the second performs the association analysis.
Always read the screen output, which suggests arguments and estimates memory usage.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
GCTA-LOCO Step 1:
The main argument is --GCTA-LOCO-step1 <outfile>.
This requires the options
--bfile/--speed <datastem> or --bgen <datafile> - to specify the genetic data files (see File Formats).
--pheno <phenofile> - to specify phenotypes (in PLINK format). If <phenofile> contains more than one phenotype, specify which should be used with --mpheno <integer> or --pheno-name <string> (the latter requires that <phenofile> has a header row), or use --mpheno ALL to analyse all phenotypes
You can use --keep <keepfile> and/or --remove <removefile> to restrict to a subset of samples, and --extract <extractfile> and/or --exclude <excludefile> to restrict to a subset of predictors (for more details, see Data Filtering).
You can use --covar <covarfile> or --factors <factorfile> to provide quantitative or categorical covariates (in PLINK format) as fixed effects in the regression (if <covarfile> contains multiple covariates, you can specify a subset using either --covar-names <string> or --covar-numbers <string>).
If you have very many predictors (e.g., over one million), which is common when analysing imputed SNP genotypes, please read the Dense Data Advice below.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
GCTA-LOCO Step 2:
The main argument is --GCTA-LOCO-step2 <outfile>.
This requires the options
--bfile/--speed <datastem> or --bgen <datafile> - to specify the genetic data files (see File Formats).
--pheno <phenofile> - to specify phenotypes (in PLINK format). Samples without a phenotype will be excluded. If <phenofile> contains more than one phenotype, specify which should be used with --mpheno <integer>, or use --mpheno ALL to analyse all phenotypes.
You can use --keep <keepfile> and/or --remove <removefile> to restrict to a subset of samples, and --extract <extractfile> and/or --exclude <excludefile> to restrict to a subset of predictors (for more details, see Data Filtering).
You can use --covar <covarfile> or --factors <factorfile> to provide quantitative or categorical covariates (in PLINK format) as fixed effects in the regression (if <covarfile> contains multiple covariates, you can specify a subset using either --covar-names <string> or --covar-numbers <string>).
Please note that the options used in Step 2 must be consistent with those used in Step 1 (e.g., if you used covariates in Step 1, you must also use them in Step 2).
If you have very many predictors (e.g., over one million), which is common when analysing imputed SNP genotypes, please read the Dense Data Advice below.
The main output file is <outfile>.step2.assoc, while <outfile>.step2.summaries contains summary statistics (in the format required for use with SumHer and MegaPRS).
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Dense data advice:
Step 1 of GCTA-LOCO can be slow when there are very many predictors. Therefore, if your dataset contains over one million predictors, we recommend you only use a subset of these in Step 1 (e.g., 500,000 predictors). Doing so will have a limited impact on power, but will greatly reduce runtime. Note that you should continue to use all predictors in Step 2.
You may already have a suitable subset of predictors (e.g., you may have a list of directly-genotyped SNPs, or those passing stringent quality control). Otherwise, we you can obtain the SNP subset by performing a moderate thinning of the common predictors (e.g., if analysing SNP data, we suggest identifying SNPs with MAF > 0.01, then filtering so there are no predictors within 100kb with squared correlation above 0.5).
This can be achieved using the main argument --thin-common <output>.
The only required option is
--bfile/--gen/--sp/--speed <datastem> or --bgen <datafile> - to specify the genetic data files (see File Formats).
For details of optional arguments, see Thin Predictors.
When analysing SNP data, this command will produce the file <output>.in, which contains SNPs with MAF > 0.01, thinned so no pair within 100kb has squared correlation above 0.5 (if not using SNP data, the command will instead restrict to predictors with variance > 0.01).
You can then run Step 1 of GCTA-LOCO adding --extract <output>.in.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Example:
Here we use the binary PLINK files human.bed, human.bim and human.fam, the phenotype quant.pheno and the covariates human.covar from the Test Datasets.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
1 - GCTA-LOCO (with non-dense data).
We analyse the quantitative phenotype quant.pheno, including the covariates human.covar, by running
./ldak.out --GCTA-LOCO-step1 gctaloco --bfile human --pheno quant.pheno --covar human.covar
followed by
./ldak.out --GCTA-LOCO-step2 gctaloco --bfile human --pheno quant.pheno --covar human.covar
The main results are saved in gctaloco.step2.assoc.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2 - GCTA-LOCO with dense data.
Suppose we had very many SNPs (which is not the case here). We can analyse the quantitative phenotype quant.pheno, including the covariates human.covar, by running the following three commands
./ldak.out --thin-common subset --bfile human
./ldak.out --GCTA-LOCO-step1 gctaloco2 --bfile human --pheno quant.pheno --covar human.covar --extract subset.in
./ldak.out --GCTA-LOCO-step2 gctaloco2 --bfile human --pheno quant.pheno --covar human.covar
The first command generates subset.in, a list of thinned common predictors, which are then provided to LDAK in the second command. Note that although only a subset of SNPs are used in Step 1, all SNPs are used in Step 2 (and so the main results file gctaloco.step2.assoc contains results for all SNPs).
