I am running GWAS analyses with gemma that seem to work but when I open the centered relatedness matrix (.cXX), I do get a symmetric matrix but the main diagonal is not made of 1s ... why?
Plink and gemma commands to generate the matrix:
# Generate plink file from my VCF file (67 samples)
vcftools --gzvcf $vcf_file --plink --out $prefix_vcf
# Make binary plink files
plink --file $prefix_vcf
--make-bed --out $prefix_vcf
# Generate centered relatedness matrix with gemma
gemma -bfile $prefix_vcf
-gk 1 -o $prefix_vcf
Here the output log of gemma:
##
## GEMMA Version = 0.94
##
## Command Line Input = -bfile subset_67_accessions_wo_singletons_only_alt_allele -gk 1 -o subset_67_accessions_wo_singletons_only_alt_allele
##
## Summary Statistics:
## number of total individuals = 67
## number of analyzed individuals = 67
## number of covariates = 1
## number of phenotypes = 1
## number of total SNPs = 927314
## number of analyzed SNPs = 39678
##
## Computation Time:
## total computation time = 0.123833 min
## computation time break down:
## time on calculating relatedness matrix = 0.00733333 min
##
I get as expected a square matrix of order 67 (as my number of samples in the VCF file).
Here is the first 5 rows and columns of the matrix:
0.5265889259 0.0918289748 0.01315201643 -0.02417258371 -0.00300349980
0.0918289748 0.4426259465 0.01751500729 -0.0196104412 -0.04093555612
0.01315201643 0.01751500729 0.494663962 0.01773204554 0.03579284737
-0.02417258371 -0.0196104412 0.01773204554 0.5622735808 0.05660374681
-0.003003499807 -0.04093555612 0.03579284737 0.05660374681 0.6064086438
There is
symmetry but not a main diagonal of 1s while same individuals should be identical to themselves, shouldn't they?
The standardized matrices have the same problem, indeed it makes sense that any operation on the matrix should not affect the main diagonal.
Thanks for your help!