Skip to content

Commit

Permalink
fix a bug in GBLUP introduced when new Genotypes struct was updated
Browse files Browse the repository at this point in the history
  • Loading branch information
reworkhow committed Mar 4, 2019
1 parent fa2ed97 commit f2e92c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/1.JWAS/src/MCMC/DRY.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ function errors_args(mme,methods)
error("GBLUP runs with genotypes.")
elseif mme.M.genetic_variance == false
error("Please provide values for the genetic variance for GBLUP analysis")
elseif estimatePi == true
error("GBLUP runs with estimatePi = false.")
end
end
if mme.nModels > 1 && mme.M!=0
Expand Down
3 changes: 1 addition & 2 deletions src/1.JWAS/src/MCMC/MCMC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ function runMCMC(mme::MME,df;
sol = starting_value,
outFreq = printout_frequency,
output_samples_frequency = output_samples_frequency,
output_file = output_samples_file,
update_priors_frequency = update_priors_frequency)
output_file = output_samples_file)
else
error("No options!!!")
end
Expand Down
5 changes: 2 additions & 3 deletions src/1.JWAS/src/MCMC/MCMC_GBLUP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function MCMC_GBLUP(nIter,mme,df;
D = eigenG.values#eigenvalues

dfEffectVar = mme.df.marker #actually for genetic effect here
vEff = mme.M.G #genetic variance
vEff = mme.M.genetic_variance #genetic variance
scaleVar = vEff*(dfEffectVar-2)/dfEffectVar #scale factor for locus effects
meanVara = 0.0
meanVarg = 0.0
Expand Down Expand Up @@ -104,7 +104,6 @@ function MCMC_GBLUP(nIter,mme,df;
if iter > burnin
meanAlpha +=- meanAlpha)/(iter-burnin)
end

########################################################################
# 2.1 Genetic Covariance Matrix (Polygenic Effects) (variance.jl)
########################################################################
Expand Down Expand Up @@ -158,7 +157,7 @@ function MCMC_GBLUP(nIter,mme,df;
println("\nPosterior means at iteration: ",iter)
println("Residual variance: ",round(meanVare,digits=6))
if mme.pedTrmVec !=0
println("Polygenic effects covariance matrix \n",round(G0Mean,digits=3))
println("Polygenic effects covariance matrix \n",round.(G0Mean,digits=3))
end
println("Genetic variance (G matrix): ",round(meanVara,digits=6))
println("Genetic variance (GenSel): ",round(meanVarg,digits=6))
Expand Down

0 comments on commit f2e92c5

Please sign in to comment.