Skip to content
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

VCF file input #21

Closed
c0rbeau opened this issue Jul 27, 2021 · 2 comments
Closed

VCF file input #21

c0rbeau opened this issue Jul 27, 2021 · 2 comments
Assignees

Comments

@c0rbeau
Copy link

c0rbeau commented Jul 27, 2021

Hello. When I try to run the software with vcf file input. I get the following error.

julia> using OrdinalGWAS

julia> const datadir = normpath(joinpath(dirname(pathof(OrdinalGWAS)), "../data/"))
"C:\\Users\\Corbeau\\.julia\\packages\\OrdinalGWAS\\g7QpK\\data\\"

julia> ordinalgwas(@formula(y ~ sex), datadir * "vcf_example.csv",
           datadir * "vcf_test"; geneticformat = "VCF", vcftype = :DS)
ERROR: MethodError: no method matching copy_ds!(::Vector{Union{Missing, Float64}}, ::GeneticVariation.VCF.Reader; model=:additive, impute=true, record_chr=Any[#undef], record_pos=Any[#undef], record_ids=Any[#undef])
Closest candidates are:
  copy_ds!(::Union{AbstractArray{Union{Missing, T}, 1}, AbstractArray{Union{Missing, T}, 2}}, ::VariantCallFormat.Reader; key, model, impute, center, scale, msg, sampleID, record_chr, record_pos, record_ids, record_ref, record_alt) where T<:Real at C:\Users\Corbeau\.julia\packages\VCFTools\F07kI\src\convert.jl:651
Stacktrace:
 [1] WARNING: both OrdinalMultinomialModels and Distributions export "cor"; uses of it in module OrdinalGWAS must be qualified
WARNING: both OrdinalMultinomialModels and Distributions export "loglikelihood"; uses of it in module OrdinalGWAS must be qualified
(::OrdinalGWAS.var"#28#34"{FormulaTerm{ContinuousTerm{Float64}, Term}, Symbol, Symbol, UnitRange{Int64}, NLoptSolver, StatsModels.TableRegressionModel{OrdinalMultinomialModel{Int64, Float64, LogitLink}, Matrix{Float64}}, Symbol, Bool, DataFrames.DataFrame, GeneticVariation.VCF.Reader})(io::IOStream)
   @ OrdinalGWAS C:\Users\Corbeau\.julia\packages\OrdinalGWAS\g7QpK\src\gwas.jl:707
 [2] makestream(::OrdinalGWAS.var"#28#34"{FormulaTerm{ContinuousTerm{Float64}, Term}, Symbol, Symbol, UnitRange{Int64}, NLoptSolver, StatsModels.TableRegressionModel{OrdinalMultinomialModel{Int64, Float64, LogitLink}, Matrix{Float64}}, Symbol, Bool, DataFrames.DataFrame, GeneticVariation.VCF.Reader}, ::String, ::Vararg{String, N} where N)
   @ SnpArrays C:\Users\Corbeau\.julia\packages\SnpArrays\pDgJb\src\codec.jl:31
 [3] ordinalgwas(fittednullmodel::StatsModels.TableRegressionModel{OrdinalMultinomialModel{Int64, Float64, LogitLink}, Matrix{Float64}}, vcffile::String, nsamples::Int64, vcftype::Symbol; analysistype::String, testformula::FormulaTerm{ContinuousTerm{Float64}, Term}, test::Symbol, pvalfile::String, snpmodel::Val{1}, snpinds::Nothing, vcfrowinds::UnitRange{Int64}, solver::NLoptSolver, verbose::Bool, snpset::Nothing, e::Nothing)
   @ OrdinalGWAS C:\Users\Corbeau\.julia\packages\OrdinalGWAS\g7QpK\src\gwas.jl:678
 [4] ordinalgwas(fittednullmodel::StatsModels.TableRegressionModel{OrdinalMultinomialModel{Int64, Float64, LogitLink}, Matrix{Float64}}, geneticfile::String; analysistype::String, geneticformat::String, vcftype::Symbol, testformula::FormulaTerm{ContinuousTerm{Float64}, Term}, test::Symbol, pvalfile::String, snpmodel::Val{1}, snpinds::Nothing, geneticrowinds::Nothing, solver::NLoptSolver, verbose::Bool, snpset::Nothing, e::Nothing)
   @ OrdinalGWAS C:\Users\Corbeau\.julia\packages\OrdinalGWAS\g7QpK\src\gwas.jl:218
 [5] ordinalgwas(nullformula::FormulaTerm{Term, Term}, nulldf::DataFrames.DataFrame, geneticfile::String; nullfile::String, link::LogitLink, solver::NLoptSolver, verbose::Bool, kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol}, NamedTuple{(:geneticformat, :vcftype), Tuple{String, Symbol}}})
   @ OrdinalGWAS C:\Users\Corbeau\.julia\packages\OrdinalGWAS\g7QpK\src\gwas.jl:126
 [6] #ordinalgwas#3
   @ C:\Users\Corbeau\.julia\packages\OrdinalGWAS\g7QpK\src\gwas.jl:105 [inlined]
 [7] top-level scope
   @ REPL[4]:1

julia>
@Hua-Zhou
Copy link
Member

I can run the above code without error. My environment:

Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_EDITOR = code

@c0rbeau Maybe you can try to update the VCFTools package? My package versions are

(@v1.6) pkg> st
      Status `~/.julia/environments/v1.6/Project.toml`
  [6db4b851] BGEN v0.1.3 `https://github.com/OpenMendel/BGEN.jl#main`
  [488c2830] BSplines v0.3.2
  [a93c6f00] DataFrames v0.22.7
  [31c24e10] Distributions v0.24.18
  [c47b6ae2] GLMCopula v0.1.0 `~/.julia/dev/GLMCopula`
  [7073ff75] IJulia v1.23.2
  [f87dc7a8] JointModelMoM v0.0.1 `~/.julia/dev/JointModelMoM`
  [00428148] OrdinalGWAS v0.5.3 `https://github.com/OpenMendel/OrdinalGWAS.jl#master`
  [b51826c6] OrdinalMultinomialModels v0.3.4 `https://github.com/OpenMendel/OrdinalMultinomialModels.jl#master`
  [91a5bcdd] Plots v1.12.0
  [6f49c342] RCall v0.13.10
  [4e780e97] SnpArrays v0.3.9 `https://github.com/OpenMendel/SnpArrays.jl#master`
  [a620830f] VCFTools v0.2.2 `https://github.com/OpenMendel/VCFTools.jl#master`

@biona001
Copy link
Member

The code works for me as well. GeneticVariation has been depreciated a long time ago, so updating VCFtools.jl by ]up VCFTools should resolve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants