fastlmm / FaST-LMM

Python version of Factored Spectrally Transformed Linear Mixed Models
https://fastlmm.github.io/
Apache License 2.0
47 stars 11 forks source link

Calculate heritability #44

Closed snowformatics closed 6 months ago

snowformatics commented 6 months ago

Hi,

Is it possible to calculate heritabilty of the LMM?

Thanks

CarlKCarlK commented 6 months ago

[also sent via email]

Is it possible to calculate heritabilty of the LMM?

I believe single_snp’s “Nullh2” output column is heritability. By default, it is calculated on every chromosome excluding the chromosome of the tested SNP. (So, leave-one-out chromosome; on human data, calculated 22 times).

When you set leave_out_one_chrom to False, heritability (Nullh2) is calculated using all SNPs, including those on the same chromosome as the SNP being tested.

For accurate p-values, you typically want to leave the leave_out_one_chrom parameter set to its default (True). However, if you want a heritability estimate that includes all chromosomes (a more global estimate), you can set leave_out_one_chrom to False. Remember, the p-values from this run might not be suitable for significance testing due to the potential for inflated statistics.

-- Carl

snowformatics commented 6 months ago

Thanks a lot Carl, I will check!