# Missingness and frequency reportsplink2--bfile data --missing--freq--out qc/report# Basic filters in one passplink2--bfile data --geno 0.02 --mind 0.02 --maf 0.01 --hwe 1e-6 \--make-pgen--out qc/data_qc# LD pruning, then PCA on the pruned setplink2--pfile qc/data_qc --indep-pairwise 200 50 0.2 --out qc/pruneplink2--pfile qc/data_qc --extract qc/prune.prune.in --pca 10 --out qc/pca# Remove second-degree relatives or closerplink2--pfile qc/data_qc --king-cutoff 0.0884 --out qc/unrelated# Association with covariates (logistic for binary, linear for quantitative)plink2--pfile qc/data_qc --pheno pheno.txt --covar covar.txt \--covar-variance-standardize--glm hide-covar firth-fallback \--out results/gwas
A.4 SAIGE essentials
Step
Script
Key inputs
Key outputs
1 — null model
step1_fitNULLGLMM.R
PLINK file for GRM, phenotype file, covariates, --traitType
.rda model, .varianceRatio.txt
2 — association
step2_SPAtests.R
Dosages (BGEN/VCF/PLINK), step 1 model and variance ratio
Per-variant results: BETA, SE, p.value, AF_Allele2
A small convention that keeps analysis scripts searchable:
# TODO: work still to do
# FIXME: known to be wrong; fix before using results
# NOTE: why something is done this way
# XXX: warning; read before changing
grep -rn "FIXME" scripts/ before every release of results.