meringlab / FlashWeave.jl

Inference of microbial interaction networks from large-scale heterogeneous abundance data
Other
70 stars 8 forks source link

FlashWeave v0.19.0 fails biom_hdf5 test #30

Closed IsaacTowers closed 1 year ago

IsaacTowers commented 1 year ago

After adding FlashWeave, ran the test suite pkg> test FlashWeave which produced

Error in 'load_biom'. File data/HMP_SRA_gut/HMP_SRA_gut_tiny_hdf5.biom seems not to be valid .biom

and (after all the stacktrace) the table

Test Summary:  | Pass  Error  Total  Time
table data     |   16      1     17  5.1s
  tsv          |    4             4  1.7s
  tsv_rownames |    4             4  0.1s
  csv          |    4             4  0.0s
  biom_json    |    4             4  1.5s
  biom_hdf5    |           1      1  1.7s

Package version:

status FlashWeave
Status `~/.julia/environments/v1.8/Project.toml`
  [2be3f83a] FlashWeave v0.19.0

Julia and OS info

versioninfo()

Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 12 × Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 12 virtual cores

The same error is produced by

julia> using FlashWeave

julia> load_data("Builds/FlashWeave.jl/test/data/HMP_SRA_gut/HMP_SRA_gut_tiny_hdf5.biom")

ERROR: Error in 'load_biom'. File Builds/FlashWeave.jl/test/data/HMP_SRA_gut/HMP_SRA_gut_tiny_hdf5.biom seems not to be valid .biom
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] load_biom(data_path::String, meta_path::Nothing)
   @ FlashWeave ~/.julia/packages/FlashWeave/sniAe/src/io.jl:229
 [3] load_data(data_path::String, meta_path::Nothing; transposed::Bool, otu_data_key::String, meta_data_key::String, otu_header_key::String, meta_header_key::String)
   @ FlashWeave ~/.julia/packages/FlashWeave/sniAe/src/io.jl:46
 [4] load_data (repeats 2 times)
   @ ~/.julia/packages/FlashWeave/sniAe/src/io.jl:29 [inlined]
 [5] top-level scope
   @ REPL[3]:1

caused by: Unexpected character
Line: 0
Around: ...HDF     ...
            ^

Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] _error(message::String, ps::JSON.Parser.MemoryParserState)
    @ JSON.Parser ~/.julia/packages/JSON/NeJ9k/src/Parser.jl:140
  [3] parse_jsconstant(#unused#::JSON.Parser.ParserContext{Dict{String, Any}, Int64, true, nothing}, ps::JSON.Parser.MemoryParserState)
    @ JSON.Parser ~/.julia/packages/JSON/NeJ9k/src/Parser.jl:193
  [4] parse_value(pc::JSON.Parser.ParserContext{Dict{String, Any}, Int64, true, nothing}, ps::JSON.Parser.MemoryParserState)
    @ JSON.Parser ~/.julia/packages/JSON/NeJ9k/src/Parser.jl:170
  [5] parse(str::String; dicttype::Type, inttype::Type{Int64}, allownan::Bool, null::Nothing)
    @ JSON.Parser ~/.julia/packages/JSON/NeJ9k/src/Parser.jl:450
  [6] (::JSON.Parser.var"#4#5"{DataType, DataType, Nothing, Bool, Bool, Int64})(io::IOStream)
    @ JSON.Parser ~/.julia/packages/JSON/NeJ9k/src/Parser.jl:511
  [7] open(f::JSON.Parser.var"#4#5"{DataType, DataType, Nothing, Bool, Bool, Int64}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:384
  [8] open
    @ ./io.jl:381 [inlined]
  [9] #parsefile#3
    @ ~/.julia/packages/JSON/NeJ9k/src/Parser.jl:509 [inlined]
 [10] parsefile
    @ ~/.julia/packages/JSON/NeJ9k/src/Parser.jl:502 [inlined]
 [11] load_biom_json(data_path::String)
    @ FlashWeave ~/.julia/packages/FlashWeave/sniAe/src/io.jl:195
 [12] load_biom(data_path::String, meta_path::Nothing)
    @ FlashWeave ~/.julia/packages/FlashWeave/sniAe/src/io.jl:227
 [13] load_data(data_path::String, meta_path::Nothing; transposed::Bool, otu_data_key::String, meta_data_key::String, otu_header_key::String, meta_header_key::String)
    @ FlashWeave ~/.julia/packages/FlashWeave/sniAe/src/io.jl:46
 [14] load_data (repeats 2 times)
    @ ~/.julia/packages/FlashWeave/sniAe/src/io.jl:29 [inlined]
 [15] top-level scope
    @ REPL[3]:1

caused by: MethodError: no method matching read(::Vector{Int64})
Closest candidates are:
  read(::Union{Base.DevNull, Core.CoreSTDERR, Core.CoreSTDOUT}, ::Type{UInt8}) at coreio.jl:23
  read(::Union{HDF5.Attribute, HDF5.Dataset}) at ~/.julia/packages/HDF5/NqGY2/src/readwrite.jl:36
  read(::Union{HDF5.Attribute, HDF5.Dataset}, ::Type{String}, ::Any...) at ~/.julia/packages/HDF5/NqGY2/src/readwrite.jl:61
  ...
Stacktrace:
 [1] load_biom_hdf5(data_path::String)
   @ FlashWeave ~/.julia/packages/FlashWeave/sniAe/src/io.jl:212
 [2] load_biom(data_path::String, meta_path::Nothing)
   @ FlashWeave ~/.julia/packages/FlashWeave/sniAe/src/io.jl:224
 [3] load_data(data_path::String, meta_path::Nothing; transposed::Bool, otu_data_key::String, meta_data_key::String, otu_header_key::String, meta_header_key::String)
   @ FlashWeave ~/.julia/packages/FlashWeave/sniAe/src/io.jl:46
 [4] load_data (repeats 2 times)
   @ ~/.julia/packages/FlashWeave/sniAe/src/io.jl:29 [inlined]
 [5] top-level scope
   @ REPL[3]:1
jtackm commented 1 year ago

Hi Isaac,

Thanks for your report. This issue started a bit ago, driven by unexpected breaking changes in a dependency. Things should already work on master (you can try with ]add FlashWeave#master), I just haven't gotten around to tag the version yet. Let me know if that solves your issue.

jtackm commented 1 year ago

The release is tagged now, so just ]up FlashWeave should get you the fixed version (v0.19.1)

IsaacTowers commented 1 year ago

Great thanks! Version 0.19.1 passes all tests.