-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR: MethodError: no method matching zero(::Type{Any}) when fitting multivariate Bayesian genomic regression #64
Comments
Just a quick update to this issue. I've found that when I run the example multivariate model found here), I stumble upon the same issue. For example: using JWAS,JWAS.Datasets,DataFrames,CSV
phenofile = Datasets.dataset("example","phenotypes.txt")
pedfile = Datasets.dataset("example","pedigree.txt")
genofile = Datasets.dataset("example","genotypes.txt")
phenotypes = CSV.read(phenofile,delim = ',',header=true,missingstrings=["NA"])
pedigree = get_pedigree(pedfile,separator=",",header=true);
model_equation2 ="y1 = intercept + x1 + x3 + ID + dam
y2 = intercept + x1 + x2 + x3 + ID
y3 = intercept + x1 + x1*x3 + x2 + ID";
model2 = build_model(model_equation2);
set_covariate(model2,"x1");
set_random(model2,"x2");
set_random(model2,"ID dam",pedigree);
add_genotypes(model2,genofile,separator=',');
out2=runMCMC(model2,phenotypes,methods="BayesC",estimatePi=true);
This produces the same error: ERROR: MethodError: no method matching zero(::Type{Any})
Closest candidates are:
zero(::Type{Union{Missing, T}}) where T at missing.jl:105
zero(::Type{Missing}) at missing.jl:103
zero(::Type{LibGit2.GitHash}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LibGit2/src/oid.jl:220
...
Stacktrace:
[1] zero(::Type{Any}) at ./missing.jl:105
[2] _zeros_eltypes at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/SparseArrays/src/higherorderfns.jl:204 [inlined]
[3] _noshapecheck_map(::typeof(+), ::SparseArrays.SparseMatrixCSC{Any,Int64}, ::SparseArrays.SparseMatrixCSC{Float64,Int64}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/SparseArrays/src/higherorderfns.jl:159
[4] map(::typeof(+), ::SparseArrays.SparseMatrixCSC{Any,Int64}, ::SparseArrays.SparseMatrixCSC{Float64,Int64}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/SparseArrays/src/higherorderfns.jl:1153
[5] +(::SparseArrays.SparseMatrixCSC{Any,Int64}, ::SparseArrays.SparseMatrixCSC{Float64,Int64}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/SparseArrays/src/sparsematrix.jl:1648
[6] addVinv(::JWAS.MME) at /home/mark/.julia/packages/JWAS/4xynz/src/1.JWAS/src/buildMME/random_effects.jl:209
[7] getMME(::JWAS.MME, ::DataFrame) at /home/mark/.julia/packages/JWAS/4xynz/src/1.JWAS/src/buildMME/build_MME.jl:261
[8] init_mixed_model_equations(::JWAS.MME, ::DataFrame, ::Bool) at /home/mark/.julia/packages/JWAS/4xynz/src/1.JWAS/src/JWAS.jl:581
[9] runMCMC(::JWAS.MME, ::DataFrame; heterogeneous_residuals::Bool, chain_length::Int64, starting_value::Bool, burnin::Int64, output_samples_frequency::Int64, update_priors_frequency::Int64, methods::String, estimate_variance::Bool, Pi::Float64, estimatePi::Bool, estimateScale::Bool, single_step_analysis::Bool, pedigree::Bool, categorical_trait::Bool, missing_phenotypes::Bool, constraint::Bool, causal_structure::Bool, outputEBV::Bool, output_heritability::Bool, seed::Bool, printout_model_info::Bool, printout_frequency::Int64, big_memory::Bool, double_precision::Bool, output_samples_file::String, output_samples_for_all_parameters::Bool) at /home/mark/.julia/packages/JWAS/4xynz/src/1.JWAS/src/JWAS.jl:252
[10] top-level scope at REPL[19]:1
|
I get the same error with Julia 1.4.1, but it works as expected with Julia 1.1.1. |
I ran this example successfully with Julia 1.3.1 |
@markcharder @fmorgante Thanks for letting me know. There was a bug with Julia 1.4. I have released JWAS 0.8.4. It should work in Julia1.4 now. More details about the bug can be found here. |
@reworkhow thank you for fixing this! I also noticed that when setting julia> add_genotypes(model2,genofile,separator=',', center=false);
The delimiter in genotypes.txt is ','.
The header (marker IDs) is provided in genotypes.txt.
ERROR: MethodError: objects of type Bool are not callable
Stacktrace:
[1] #readgenotypes#52(::Char, ::Bool, ::Bool, ::Function, ::String) at /home/fmorgante/.julia/packages/JWAS/fZ8iA/src/1.JWAS/src/markers/readgenotypes.jl:108
[2] #readgenotypes at /home/fmorgante/.julia/packages/JWAS/fZ8iA/src/1.JWAS/src/markers/readgenotypes.jl:0 [inlined]
[3] #add_genotypes#51(::Char, ::Bool, ::Bool, ::Bool, ::Int64, ::Function, ::JWAS.MME, ::String, ::Bool) at /home/fmorgante/.julia/packages/JWAS/fZ8iA/src/1.JWAS/src/markers/readgenotypes.jl:61
[4] #add_genotypes at ./none:0 [inlined] (repeats 2 times)
[5] top-level scope at none:0 At the moment, I am on Julia 1.1.1. Do you have any idea why? |
@fmorgante Can you update your JWAS now to the latest version to try? |
@reworkhow It works now, thanks! |
Just a note to say thank you to the developers and I am greatly looking forward to trying out the software again :) |
I am hoping to fit a multiple trait Bayesian genomic prediction model using the JWAS package. I've managed to run the tutorials without any issues. However, when I apply the model to my own data, I get an error message. I've checked and re-checked the format of the data, which, as far as I can tell, is fine. In fact, the analysis will run for a single trait model but only throws the error for a multi-trait model.
Here is a snippet of some preliminary code that I ran recently:
This is what the phenotypes file looks like:
This is what the genotypes file looks like:
The error message that I get from running this model is as follows:
I would really appreciate if anybody can figure out what the issue might be. Sorry for such a long message.
Mark
The text was updated successfully, but these errors were encountered: