Skip to content

Commit

Permalink
Merge pull request #115 from zhaotianjing/master
Browse files Browse the repository at this point in the history
fix a bug in nn-mm with no omics data
  • Loading branch information
reworkhow authored Mar 17, 2022
2 parents 3b3908a + 394ad8d commit a7d6be8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/1.JWAS/src/JWAS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function runMCMC(mme::MME,df;
fitting_J_vector = true, #parameters for single-step analysis
causal_structure = false,
mega_trait = mme.nonlinear_function == false ? false : true, #NNBayes -> default mega_trait=true
missing_phenotypes = true,
missing_phenotypes = mme.nonlinear_function == false ? true : false, #NN-MM -> missing hidden nodes will be sampled
constraint = false,
#Genomic Prediction
outputEBV = true,
Expand Down
11 changes: 5 additions & 6 deletions src/1.JWAS/src/Nonlinear/nnbayes_check.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,15 @@ function nnlmm_initialize_missing(mme,df)
end
end
end
# add indicators for individuals with full omics data, so their omics won't be sampled
n_observed_omics = sum(mme.missingPattern,dims=2) #number of observed omics for each ind
n_omics = length(mme.lhsVec) #number of omics
full_omics = n_observed_omics .== n_omics #indicator for ind with full omics
mme.incomplete_omics = vec(.!full_omics) #indicator for ind with no/partial omics

else #NN-Bayes with hidden nodes (G3 paper)
#all omics should be missing, the missingPattern should be all 0
#but we already set y1,...,y5 as yobs, so we have to build missingPattern
# byhand.
mme.missingPattern = .!ismissing.(Array{Missing}(missing, size(df[!,mme.lhsVec])))
end
# add indicators for individuals with full omics data, so their omics won't be sampled
n_observed_omics = sum(mme.missingPattern,dims=2) #number of observed omics for each ind
n_omics = length(mme.lhsVec) #number of omics
full_omics = n_observed_omics .== n_omics #indicator for ind with full omics
mme.incomplete_omics = vec(.!full_omics) #indicator for ind with no/partial omics
end

0 comments on commit a7d6be8

Please sign in to comment.