本篇,介绍GCTA这个软件的安装。
GCTA官网:https://yanglab.westlake.edu.cn/software/gcta/#Download

这个软件是开源的,源码在github上:https://github.com/jianyangqt/gcta
在终端中运行下面命令:
wget https://yanglab.westlake.edu.cn/software/gcta/bin/gcta_1.94.0beta.zip
下载成功:

文件:
gcta_1.94.0beta.zip
unzip gcta_1.94.0beta.zip
文件:
gcta_1.94.0beta
├── gcta64
├── MIT_License.txt
├── README.txt
├── test.bed
├── test.bim
├── test.fam
└── test.phen
进入gcta_1.94.0beta文件夹,运行下面命令:
根据plink的二进制文件,进行G矩阵的构建(Yang的方法),生成二进制亲缘关系矩阵。
./gcta64 --bfile test --make-grm --out gmat
运行日志:
Options:
--bfile test
--make-grm
--out gmat
Note: GRM is computed using the SNPs on the autosomes.
Reading PLINK FAM file from [test.fam]...
3925 individuals to be included from FAM file.
3925 individuals to be included. 1643 males, 2282 females, 0 unknown.
Reading PLINK BIM file from [test.bim]...
1000 SNPs to be included from BIM file(s).
Computing the genetic relationship matrix (GRM) v2 ...
Subset 1/1, no. subject 1-3925
3925 samples, 1000 markers, 7704775 GRM elements
IDs for the GRM file have been saved in the file [gmat.grm.id]
Computing GRM...
100% finished in 0.3 sec
1000 SNPs have been processed.
Used 1000 valid SNPs.
The GRM computation is completed.
Saving GRM...
GRM has been saved in the file [gmat.grm.bin]
Number of SNPs in each pair of individuals has been saved in the file [gmat.grm.N.bin]
结果文件:
gmat.grm.bin gmat.grm.id gmat.grm.N.bin gmat.log


在bin中打开git终端:

运行代码:
./gcta64.exe --bfile ../test --make-grm --out ../gmat

结果文件:

可以看到,Windows和Linux运行命令一致。gcta也有Mac系统,和plink类似。
为了使用更方便,可以将gcta64可执行文件放到bin文件下,这样就可以直接键入gcta64进行分析。
「windows下:」
cp gcta64.exe ~/bin/
「Linux下:」
cp gcta64 ~/bin/