syntheke / bayesR

Bayesian hierarchical model for complex trait analysis
44 stars 26 forks source link

Printing additional information for all SNPs with -snpout argument #12

Closed leticia-lara closed 3 years ago

leticia-lara commented 3 years ago

Hi, I think this is not an issue per se but a specific case where I would like to print the effect size of all SNPs and not only the selected ones. I need to sample from the posterior distribution the SNP effects. To run bayesR I’m using this command line:

bayesR -bfile trainPopData -out simout -numit 100000 -burnin 1000 -thin 10 -snpout

the -snpout argument provides me with additional information for SNPs selected within the model in the format of: mixture class:SNP#:effect size. However, I would like the effect size for all SNPs and not only for the selected ones. Please, do you know how can I obtain this full information?

Thank you very much

syntheke commented 3 years ago

The SNP effects are estimated by the sample means of the posterior estimates and are given in the 'beta' column in file simout.param.

Cheers

leticia-lara commented 3 years ago

Thank you. However, how can I obtain 1000 samples? Basically I have 10500 markers and I would like to obtain a matrix with 1000 x 10500, were each row is one sample from the posterior distribution.

Cheers

syntheke commented 3 years ago

Information for each saved MCMC sample is given in the snpout file. For example, if a row contains information for 100 SNPs the remaining 10400 SNPs have zero effects. However, the effect size of a SNP is given as variance explained (beta^2).
If you want betas you have to change the line in subroutine output_snploc from "write(ce,'(e15.6)') g(i)**2" to "write(ce,'(e15.6)') g(i)"

Cheers