scverse/Muon.jl

Error reading h5ad AnnData object file

lbotecur opened this issue · 2 comments

Hello:

I am trying to read an h5ad AnnData object file in this way:

using Muon

file = "msc_sokm.h5ad"
ad = readh5ad(file)

but I get this error:

ERROR: MethodError: Cannot `convert` an object of type 
  Vector{NamedTuple{(Symbol("0"), Symbol("1"), Symbol("2"), Symbol("3"), Symbol("4"), Symbol("5"), Symbol("6"), Symbol("7"), Symbol("8"), Symbol("9")), NTuple{10, Float32}}} to an object of type 
  Union{AbstractString, Number, DataFrame, Dict, AbstractArray{<:AbstractString}, AbstractArray{<:Number}}
Closest candidates are:
  convert(::Type{T}, ::T) where T at ~/julia-1.7.2/share/julia/base/essentials.jl:218
Stacktrace:
 [1] setindex!(h::Dict{String, Union{AbstractString, Number, DataFrame, Dict, AbstractArray{<:AbstractString}, AbstractArray{<:Number}}}, v0::Vector{NamedTuple{(Symbol("0"), Symbol("1"), Symbol("2"), Symbol("3"), Symbol("4"), Symbol("5"), Symbol("6"), Symbol("7"), Symbol("8"), Symbol("9")), NTuple{10, Float32}}}, key::String)
   @ Base ./dict.jl:381
 [2] read_dict_of_mixed(f::HDF5.Group; kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:separate_index,), Tuple{Bool}}})
   @ Muon ~/.julia/packages/Muon/eLqpV/src/hdf5_io.jl:113
 [3] read_auto(f::HDF5.Group; kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:separate_index,), Tuple{Bool}}})
   @ Muon ~/.julia/packages/Muon/eLqpV/src/hdf5_io.jl:96
 [4] read_dict_of_mixed(f::HDF5.Group; kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:separate_index,), Tuple{Bool}}})
   @ Muon ~/.julia/packages/Muon/eLqpV/src/hdf5_io.jl:113
 [5] AnnData(file::HDF5.File, backed::Bool, checkversion::Bool)
   @ Muon ~/.julia/packages/Muon/eLqpV/src/anndata.jl:77
 [6] readh5ad(filename::String; backed::Bool)
   @ Muon ~/.julia/packages/Muon/eLqpV/src/anndata.jl:150
 [7] readh5ad
   @ ~/.julia/packages/Muon/eLqpV/src/anndata.jl:142 [inlined]
 [8] main()
   @ Main ~/working_with_Julia/ICDM_2022/data_exploration.jl:6
 [9] top-level scope
   @ ~/working_with_Julia/ICDM_2022/data_exploration.jl:9

I am using Julia v1.7.2 and Muon v0.1.1.

I don't know if I am doing something wrong.

Thank you.

I think this is a duplicate of #10. The fix is not in a release yet, try installing the latest Muon.jl directly from Github

Sorry, I didn't read it. Thank you for the response. I'll install the next release from GitHub.