HaojiaWu / CellScopes.jl

A Julia package for single cell and spatial data analysis
MIT License
26 stars 2 forks source link

issue of reading visiumHD file #10

Open Sophieliula opened 1 month ago

Sophieliula commented 1 month ago

hd = cs.read_visiumHD(hd_dir)

  1. loading 2um binned data... Formatting cell polygons... Progress: 100%[==================================================] Time: 0:00:5039m
  2. 2um binned data loaded!
  3. loading 8um binned data... Formatting cell polygons... Progress: 100%[==================================================] Time: 0:00:02
  4. 8um binned data loaded!
  5. loading 16um binned data... Formatting cell polygons...
  6. 16um binned data loaded! MethodError: no method matching Union{Matrix{ColorTypes.Gray{FixedPointNumbers.N0f8}}, Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}, Matrix{ColorTypes.RGBA{FixedPointNumbers.N0f8}}}(::Matrix{ColorTypes.RGB{FixedPointNumbers.N0f16}})

Stacktrace: [1] convert(#unused#::Type{Union{Matrix{ColorTypes.Gray{FixedPointNumbers.N0f8}}, Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}, Matrix{ColorTypes.RGBA{FixedPointNumbers.N0f8}}}}, a::Matrix{ColorTypes.RGB{FixedPointNumbers.N0f16}}) @ Base ./array.jl:554 [2] convert(#unused#::Type{Union{Nothing, Matrix{ColorTypes.Gray{FixedPointNumbers.N0f8}}, Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}, Matrix{ColorTypes.RGBA{FixedPointNumbers.N0f8}}}}, x::Matrix{ColorTypes.RGB{FixedPointNumbers.N0f16}}) @ Base ./some.jl:36 [3] CellScopes.VisiumImgObject(highresImage::Matrix{ColorTypes.RGB{FixedPointNumbers.N0f16}}, lowresImage::Matrix{ColorTypes.RGB{FixedPointNumbers.N0f16}}, fullresImage::Nothing, detectedTissue::Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}, alignedImage::Matrix{ColorTypes.RGB{FixedPointNumbers.N0f8}}, jsonParameters::Dict{String, Any}) @ CellScopes ~/.julia/packages/CellScopes/pM38e/src/spatial/sp_objects.jl:249 [4] read_visiumHD(hd_dir::String; min_genes::Vector{Int64}, min_cells::Vector{Int64}, prefix::Nothing, postfix::Nothing, default_bin::String) @ CellScopes ~/.julia/packages/CellScopes/pM38e/src/fileio.jl:660 [5] read_visiumHD(hd_dir::String) @ CellScopes ~/.julia/packages/CellScopes/pM38e/src/fileio.jl:628 [6] top-level scope @ In[6]:1

HaojiaWu commented 1 month ago

I tried using hd = cs.read_visiumHD(hd_dir) to read the Spaceranger output from two samples again, and I couldn't reproduce the error you came across. Please make sure that hd_dir is the output directory from Spaceranger to use this function correctly. Other troubleshooting steps you can take include reinstalling CellScopes using Julia 1.8.4. I tested CellScopes on both Julia 1.7.3 and Julia 1.8.4, and it works fine. Other users have reported dependency issues with newer versions of Julia.