Biometris / statgenGWAS

See https://biometris.github.io/statgenGWAS for a full description
https://biometris.github.io/statgenGWAS/
12 stars 3 forks source link

propSNPVar #9

Closed ljbrzozowski closed 1 year ago

ljbrzozowski commented 2 years ago

Hi, I was wondering if you could provide documentation about the 'propSnpVar' provided in the output of the 'runSingleTraitGwas' function? Mostly, I'm not sure how to get from the 'propSnpVar' to percent phenotypic variation explained. Thanks!

BartJanvanRossum commented 2 years ago

Sorry for the slow reply. Indeed the documentation for propSnpVar seems to be completely lacking from the documentation. I will make sure it is included in the next version. The proportion is computed as follows: beta^2 * var(snp) / var(pheno)
Here beta is the snp effect, var(snp) the variance for the snp and var(pheno) the variance of the phenotypic values.

MARCPUCV commented 1 year ago

Hi, I have a question. Is the var(snp) the same genetic variance? where you can extract the var(snp)? Thanks!!

BartJanvanRossum commented 1 year ago

There is no function to extract the variance for each snp, however you can compute it from the marker matrix like this:

apply(X = markers, MARGIN = 2, FUN = var)

So var(snp) is the variance for the snp in the marker matrix

BartJanvanRossum commented 1 year ago

This is now documented in the vignette of the new package version that just made it to CRAN