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

Error when estimating boundaries #37

Closed
kleejin opened this issue Mar 8, 2022 · 3 comments
Closed

Error when estimating boundaries #37

kleejin opened this issue Mar 8, 2022 · 3 comments

Comments

@kleejin
Copy link

kleejin commented Mar 8, 2022

Hi there, I have tried running this on CentOS and MacOS and both instances, the run fails to estimate boundaries and I get the following error. The run still completes and generates the rest of the output files. Any thoughts or troubleshooting tips would be helpful. Thank you!

run parameters:
Baysor run -x x -y y -z z --gene gene -m 30 --n-clusters 3 -s 50 -p --save-polygons=geojson -o $OUTDIR$f $f

error:

[07:57:16] Info: Estimating boundary polygons
[07:58:54] Error: MethodError(Matrix{var"#s565"} where var"#s565"<:Unsigned, (Matrix{Int64}(undef, 0, 0),), 0x00000000000074c6)
|
| convert(#unused#::Type{Matrix{var"#s565"} where var"#s565"<:Unsigned}, a::Matrix{Int64}) at array.jl:532
| find_grid_point_labels_kde(pos_data::Matrix{Float64}, cell_labels::Vector{Int64}, min_x::Vector{Float64}, max_x::Vector{Float64}; grid_step::Float64, bandwidth::Float64, dens_threshold::Float64, min_molecules_per_cell::Int64, verbose::Bool) at boundary_estimation.jl:165
| (::Baysor.var"#find_grid_point_labels_kde##kw")(::NamedTuple{(:grid_step, :bandwidth), Tuple{Float64, Float64}}, ::typeof(Baysor.find_grid_point_labels_kde), pos_data::Matrix{Float64}, cell_labels::Vector{Int64}, min_x::Vector{Float64}, max_x::Vector{Float64}) at boundary_estimation.jl:159
| boundary_polygons(pos_data::Matrix{Float64}, cell_labels::Vector{Int64}; min_x::Nothing, max_x::Nothing, grid_step::Float64, min_border_length::Int64, shape_method::Symbol, max_dev::Float64, bandwidth::Float64, exclude_labels::Vector{Int64}, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) at boundary_estimation.jl:263
| boundary_polygons at boundary_estimation.jl:254 [inlined]
| #boundary_polygons#214 at boundary_estimation.jl:248 [inlined]
| (::Baysor.var"#boundary_polygons##kw")(::NamedTuple{(:grid_step, :bandwidth), Tuple{Float64, Float64}}, ::typeof(Baysor.boundary_polygons), spatial_df::DataFrames.DataFrame, args::Vector{Int64}) at boundary_estimation.jl:248
| (::Baysor.var"#330#334"{DataFrames.DataFrame, Vector{Int64}, Dict{String, Any}, Float64})(mask::BitVector) at main.jl:220
| #47 at ProgressMeter.jl:991 [inlined]
| iterate at generator.jl:47 [inlined]
| _collect(c::Vector{BitVector}, itr::Base.Generator{Vector{BitVector}, ProgressMeter.var"#47#50"{Distributed.RemoteChannel{Channel{Bool}}, Baysor.var"#330#334"{DataFrames.DataFrame, Vector{Int64}, Dict{String, Any}, Float64}}}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1}) at array.jl:695
| collect_similar(cont::Vector{BitVector}, itr::Base.Generator{Vector{BitVector}, ProgressMeter.var"#47#50"{Distributed.RemoteChannel{Channel{Bool}}, Baysor.var"#330#334"{DataFrames.DataFrame, Vector{Int64}, Dict{String, Any}, Float64}}}) at array.jl:606
| map(f::Function, A::Vector{BitVector}) at abstractarray.jl:2294
| macro expansion at ProgressMeter.jl:990 [inlined]
| macro expansion at task.jl:387 [inlined]
| macro expansion at ProgressMeter.jl:989 [inlined]
| macro expansion at task.jl:387 [inlined]
| progress_map(::Function, ::Vararg{Any, N} where N; mapfun::Function, progress::ProgressMeter.Progress, channel_bufflen::Int64, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) at ProgressMeter.jl:982
| progress_map(::Function, ::Vararg{Any, N} where N) at ProgressMeter.jl:978
| plot_transcript_assignment_panel(df_res::DataFrames.DataFrame, assignment::Vector{Int64}, args::Dict{String, Any}; clusters::Vector{Int64}, prior_polygons::Vector{Matrix{Float64}}, gene_colors::Vector{ColorTypes.Lab{Float64}}) at main.jl:220
| (::Baysor.var"#plot_transcript_assignment_panel##kw")(::NamedTuple{(:clusters, :prior_polygons, :gene_colors), Tuple{Vector{Int64}, Vector{Matrix{Float64}}, Vector{ColorTypes.Lab{Float64}}}}, ::typeof(Baysor.plot_transcript_assignment_panel), df_res::DataFrames.DataFrame, assignment::Vector{Int64}, args::Dict{String, Any}) at main.jl:205
| save_segmentation_results(bm_data::Baysor.BmmData{3}, gene_names::Vector{String}, args::Dict{String, Any}; mol_clusts::NamedTuple{(:exprs, :assignment, :diffs, :assignment_probs, :change_fracs), Tuple{Matrix{Float64}, Vector{Int64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}}}, comp_segs::Nothing, prior_polygons::Vector{Matrix{Float64}}) at main.jl:414
| (::Baysor.var"#save_segmentation_results##kw")(::NamedTuple{(:mol_clusts, :comp_segs, :prior_polygons), Tuple{NamedTuple{(:exprs, :assignment, :diffs, :assignment_probs, :change_fracs), Tuple{Matrix{Float64}, Vector{Int64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}}}, Nothing, Vector{Matrix{Float64}}}}, ::typeof(Baysor.save_segmentation_results), bm_data::Baysor.BmmData{3}, gene_names::Vector{String}, args::Dict{String, Any}) at main.jl:394
| run_cli_main(args::Vector{String}) at main.jl:479
| run_cli(args::Vector{String}) at common.jl:118
| run_cli at common.jl:103 [inlined]
| julia_main at common.jl:139 [inlined]
| julia_main() at none:36
└ Baysor /home/runner/work/Baysor/Baysor/src/cli/common.jl:132

env:

LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.8.2003 (Core)
Release: 7.8.2003
Codename: Core

@Bisho2122
Copy link

I also got the same error, @kleejin have you found a solution already ?

@kleejin
Copy link
Author

kleejin commented Apr 1, 2022

@Bisho2122 No I have not yet found a solution. The upside is the cell by gene info is still output, so I can continue to analyze the data without the boundary info.

@VPetukhov
Copy link
Collaborator

Apologies for the late response! The new version 0.6.0 has a different method for polygon estimation, and shouldn't suffer from this problem. Please, let me know if it persists.

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

3 participants