Why main diagonal of gemma relatedness matrix is not equal to 1

254 views
Skip to first unread message

Johan Zicola

unread,
Aug 1, 2018, 8:54:32 AM8/1/18
to gemma-discussion
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!


Xiang Zhou

unread,
Jun 3, 2019, 9:49:07 AM6/3/19
to gemma-discussion
The centered relatedness matrix does not scale each column of the genotype matrix, so the main diagonal of the resulting relatedness matrix will not be close to 1s (usually around 0.3 depending on maf etc.). If you use the scaled relatedness matrix (.sXX), then the main diagonal should be made of values that are very close to 1s. 

johan....@gmail.com

unread,
Feb 14, 2024, 6:04:39 AMFeb 14
to gemma-discussion
Thanks Zhou!
Could you indicate in which case you would use the centered relatedness matrix? It is not clear in the GEMMA documentation.
Reply all
Reply to author
Forward
0 new messages