HIBLUP has the function of calculating PCA for a population, the genotype or the relationship matrix should be provided.
Calculating PCs from genotype
./hiblup --pca --bfile demo --out demo
Note that user can add flag --step n
to control the memory cost, and specify flag --npc n
to output several number of PCs instead of all.
Calculating PCs from XRM
./hiblup --pca --xrm demo.GA --npc 5 --out demo
There are two files demo.pc
and demo.pcp
will be generated.
The file demo.pc
contains the calculated PCs, overview of the file:
id PC1 PC2 PC3 PC4 PC5 IND0701 0.0413326 -0.00664808 -0.00795809 0.0218009 -0.0156735 IND0702 0.00856316 0.0378125 0.000503819 0.0205049 0.00972465 IND0703 -0.00793242 0.0458023 -0.00438572 -0.0173733 -0.0254701 IND0704 -0.00793248 0.0458023 -0.00438575 -0.0173733 -0.0254701
The file demo.pcp
contains the Proportion and Cumulative Proportion of variance of PCs, overview of the file:
Components PC1 PC2 PC3 PC4 PC5 Standard deviation 4.23976 4.10211 3.76024 3.66821 3.60725 Proportion of Variance 0.0224695 0.0210342 0.0176743 0.0168197 0.0162653 Cumulative Proportion 0.0224695 0.0435037 0.0611779 0.0779976 0.094263