Use of Bayesian Regression Method for GWAS

4 downloads 0 Views 63KB Size Report
A simulated data set is used to demonstrate the use of the JWAS package for GWAS using Bayesian regression. JWAS is a Julia package for whole genome ...
GWASEXample

3/27/17, 3(12 PM

Use of Bayesian Regression Method for GWAS A simulated data set is used to demonstrate the use of the JWAS package for GWAS using Bayesian regression. JWAS is a Julia package for whole genome analyses, and this is a Jupyter notebook that demonstrates its use for GWAS. Here are links to documentation for Julia and Jupyter: Julia (http://julia.readthedocs.io/en/latest/) and Jupyter (http://jupyter.org). The simulated data are from 1,000 individuals with 2,000 SNPs on each of 10 chromosomes. On each chromosome, 10 randomly selected SNPs were treated as QTL with normally distributed substitution effects. The residual variance for the trait was chosen to give a trait heritability of about 0.5.

Installation of JWAS package In Julia, use the command: Pkg.add("JWAS") add package JWAS to your system. To update to the developer version of the package, use command: Pkg.checkout("JWAS") These need to be done only once for installation. Detailed documentation for JWAS is available here (http://nbviewer.jupyter.org/github/reworkhow/JWAS.jl/blob/master/docs/index.ipynb). In [1]: using JWAS, DataFrames In [2]: using JWAS:misc In [3]: srand(31415);

JWAS In [4]: M=readdlm("genotype.csv"); phenotypes=readtable("phenotypes.csv"); nothing

http://localhost:8888/nbconvert/html/Box%20Sync/latex/papers/jabesPaper/NumericalExample/GWASEXample.ipynb?download=false

Page 1 of 3

GWASEXample

3/27/17, 3(12 PM

In [5]: R=50.0 model_equations = "y = intercept"; model = build_model(model_equations,R); G=50.0 add_markers(model,M,G,header=false); MCMCFileNAME = "MCMCSammples" @time out=runMCMC(model,phenotypes,Pi=0.95,estimatePi=true,chain_lengt h=20000, printout_frequency=5000,printout_MCMCinfo=true,methods="BayesC", output_samples_frequency=20,MCMC_marker_effects_file=MCMCFileNAME); 20000 markers on 1000 individuals were added. Priors for marker effects covariance matrix were calculated from gen etic covariance matrix and π. Marker effects covariance matrix is 0.100127.

MCMC Information: methods chain_length starting_value printout_frequency output_samples_frequency constraint missing_phenotypes update_priors_frequency Information for hyper-parameter: π (Π) π estimatePi Degree of freedom for hyper-parameters: residual variances: iid random effect variances: polygenic effect variances: marker effect variances:

BayesC 20000 false 5000 20 false false 0

0.95 true

4.000 4.000 4.000 4.000

The file MCMCSammples was created to save MCMC samples for marker ef fects. running MCMC for BayesC... 25%|██████ :18

|

http://localhost:8888/nbconvert/html/Box%20Sync/latex/papers/jabesPaper/NumericalExample/GWASEXample.ipynb?download=false

ETA: 0:17

Page 2 of 3

GWASEXample

3/27/17, 3(12 PM

Posterior means at iteration: 5000 Residual variance: 47.940875 Marker effects variance: 1.034275 π: 0.994 running MCMC for BayesC... 50%|████████████ :24

|

ETA: 0:11

|

ETA: 0:09

Posterior means at iteration: 10000 Residual variance: 48.068123 Marker effects variance: 1.037933 π: 0.994 running MCMC for BayesC... 60%|███████████████ :07Excessive output truncated after 524412 bytes. In [6]: probs,varProps=GWAS(MCMCFileNAME,model,header=false, window_size=10,threshold=0.01); Proportion of Variance:p In [7]: println("Window .01 \n") for i=1:2000 if probs[i] > 0.5 @printf("%5d %5.3f ,varProps[i],probs[i]) end end Window 80 489 529 531 601 607 857 1037 1081 1169 1178 1244 1533 1563 1665 1698 1899 1901 1949

Proportion of Variance:p 0.023 0.046 0.017 0.012 0.026 0.026 0.021 0.017 0.024 0.036 0.039 0.018 0.013 0.042 0.034 0.047 0.044 0.022 0.033

Posterior Probability: p>0

%5.3f \n", i

Posterior Probability: p>0.01 0.875 1.000 0.724 0.506 0.941 0.937 0.853 0.721 0.880 0.987 0.989 0.751 0.552 0.994 0.987 0.999 0.998 0.864 0.978

http://localhost:8888/nbconvert/html/Box%20Sync/latex/papers/jabesPaper/NumericalExample/GWASEXample.ipynb?download=false

Page 3 of 3