#Estimation of the genetic relationship matrix (GRM) from all the autosomal SNPs gcta64 --bfile sim --autosome --maf 0.01 --make-grm --out test #remove cryptic relatedness gcta64 --grm test --grm-cutoff 0.05 --make-grm --out test_rm05 #Principal component analysis gcta64 --grm test --pca 5 --out test_pca #make phenotype file awk '{print $1, $2, $6}' sim.fam > test.phen #Estimation of the variance explained by the SNPs gcta64 --grm test_rm05 --pheno test.phen --reml --out test_var #Include the PCA results as covariates gcta64 --grm test_rm025 --pheno test.phen --reml --out test_cov --qcovar test_pca.eigenvec