Last active
August 15, 2016 11:07
-
-
Save explodecomputer/093379f1f92ed092aad0 to your computer and use it in GitHub Desktop.
Zaitlen method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# name of binary plink filename (excluding .bed/.bim/.fam suffix) | |
plinkfile="" | |
# name of phenotype file in plink format (i.e. col1=fid, col2=iid, col3=phenotype | |
phenfile="" | |
# make up a name for the grm for all individuals | |
allfile="" | |
# make up a name for the grm for related individuals | |
relatedsfile="" | |
# maximum relatedness threshold | |
threshold=0.05 | |
# make up a name for output file (it will have .hsq appended to the end by gcta) | |
outfile="" | |
gcta64 \ | |
--bfile ${plinkfile} \ | |
--make-grm \ | |
--maf 0.01 \ | |
--out ${allfile} | |
gcta64 \ | |
--grm ${allfile} \ | |
--pca 10 \ | |
--out ${allfile} | |
R --no-save --args ${allfile} ${relatedsfile} ${threshold} < remove_unrelateds.R | |
echo -e "${allfile}\n${relatedsfile}" > mgrm.txt | |
gcta64 \ | |
--mgrm mgrm.txt \ | |
--pheno ${phenfile} \ | |
--qcovar ${allfile}.eigenvec \ | |
--reml \ | |
--reml-no-lrt \ | |
--out ${outfile} | |
## Alternative way to have multiple phenotypes | |
# phenotype_col="2" | |
# gcta64 \ | |
# --mgrm mgrm.txt \ | |
# --pheno ${phenfile} \ | |
# --mpheno ${phenotype_col} \ | |
# --qcovar ${allfile}.eigenvec \ | |
# --reml \ | |
# --reml-no-lrt \ | |
# --out ${outfile} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The script will do the following