Baysor icon indicating copy to clipboard operation
Baysor copied to clipboard

Same issue as #18 though I have the -p option

Open sebgoti opened this issue 1 year ago • 3 comments

Successfully ran things from the pciSeq example and still could not make the HTML files:

/home/segonzal/baysor run -i 500 -m 8 -s 14 -o ./output_no_dapi -p ./data/pciSeq_3-3.csv

Output:

┌ Warning: No config file provided. Using default parameters. └ @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/main.jl:96 [12:51:17] Info: (2022-07-29) Run Baysor v0.5.1 [12:51:17] Info: Loading data... [12:51:28] Info: Loaded 1228540 transcripts [12:51:29] Info: Estimating noise level [12:52:00] Info: Done [12:52:11] Info: Clustering molecules... Progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████| Time: 0:02:07 Iteration: 341 Max. difference: 0.0023564694867172133 Fraction of probs changed: 0.035359858042880166 [12:54:33] Info: Algorithm stopped after 341 iterations. Error: 0.00236. Converged: true. [12:54:34] Info: Done [12:54:36] Info: Initializing algorithm. Scale: 14.0, scale std: 3.5, initial #components: 307134, #molecules: 1228540. [12:54:48] Info: Using 2D coordinates Progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████| Time: 0:31:18 Iteration: 500 Noise level, %: 29.32 Num. components: 49220 [13:26:31] Info: Processing complete. [13:26:57] Info: Estimating local colors [13:29:04] Info: Saving results to ./output_no_dapi/segmentation.csv [13:29:13] Info: Plot diagnostics ERROR: LoadError: UndefRefError: access to undefined reference Stacktrace: [1] getproperty @ ./Base.jl:42 [inlined] [2] show @ ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks/axis.jl:1210 [inlined] [3] show_delim_array(io::IOContext{IOBuffer}, itr::Tuple{NamedTuple{(:font,), Tuple{String}}, typeof(Makie.initialize_block!), Makie.Axis}, op::Char, delim::Char, cl::Char, delim_one::Bool, i1::Int64, n::Int64) @ Base ./show.jl:1244 [4] show_delim_array @ ./show.jl:1229 [inlined] [5] show(io::IOContext{IOBuffer}, t::Tuple{NamedTuple{(:font,), Tuple{String}}, typeof(Makie.initialize_block!), Makie.Axis}) @ Base ./show.jl:1262 [6] _show_default(io::IOBuffer, x::Any) @ Base ./show.jl:413 [7] show_default @ ./show.jl:396 [inlined] [8] show @ ./show.jl:391 [inlined] [9] print(io::IOBuffer, x::MethodError) @ Base ./strings/io.jl:35 [10] print_to_string(::MethodError, ::Vararg{Any}) @ Base ./strings/io.jl:144 [11] string(::MethodError, ::String) @ Base ./strings/io.jl:185 [12] macro expansion @ ./logging.jl:360 [inlined] [13] run_cli(args::Vector{String}) @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/common.jl:170 [14] run_cli() @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/common.jl:137 [15] top-level scope @ ~/baysor:3 in expression starting at /home/segonzal/baysor:3

caused by: MethodError: no method matching initialize_block!(::Makie.Axis; font="Helvetica") Closest candidates are: initialize_block!(::Makie.Axis; palette) at ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks/axis.jl:168 got unsupported keyword argument "font" initialize_block!(::Makie.Textbox) at ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks/textbox.jl:1 got unsupported keyword argument "font" initialize_block!(::Makie.Toggle) at ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks/toggle.jl:1 got unsupported keyword argument "font" ... Stacktrace: [1] kwerr(::NamedTuple{(:font,), Tuple{String}}, ::Function, ::Makie.Axis) @ Base ./error.jl:163 [2] block(::Type{Makie.Axis}, ::Makie.Figure; bbox::Nothing, kwargs::Base.Pairs{Symbol, Any, NTuple{10, Symbol}, NamedTuple{(:title, :xticksvisible, :yticksvisible, :xticklabelsize, :yticklabelsize, :xlabel, :ylabel, :xlabelpadding, :ylabelpadding, :font), Tuple{String, Bool, Bool, Int64, Int64, String, String, Int64, Int64, String}}}) @ Makie ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks.jl:403 [3] ##999 @ ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks.jl:279 [inlined] [4] plot_num_of_cells_per_iterarion(tracer::Dict{Symbol, Any}) @ Baysor ~/.julia/packages/Baysor/HvJao/src/data_processing/plots.jl:155 [5] (::Baysor.var"#329#330"{NamedTuple{(:exprs, :assignment, :diffs, :assignment_probs, :change_fracs), Tuple{Matrix{Float64}, Vector{Int64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}}}, Nothing, DataFrames.DataFrame, Vector{Int64}, Dict{Symbol, Any}})(io::IOStream) @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/main.jl:162 [6] open(::Baysor.var"#329#330"{NamedTuple{(:exprs, :assignment, :diffs, :assignment_probs, :change_fracs), Tuple{Matrix{Float64}, Vector{Int64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}}}, Nothing, DataFrames.DataFrame, Vector{Int64}, Dict{Symbol, Any}}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ Base ./io.jl:330 [7] open @ ./io.jl:328 [inlined] [8] plot_diagnostics_panel(df_res::DataFrames.DataFrame, assignment::Vector{Int64}, tracer::Dict{Symbol, Any}, args::Dict{String, Any}; clust_res::NamedTuple{(:exprs, :assignment, :diffs, :assignment_probs, :change_fracs), Tuple{Matrix{Float64}, Vector{Int64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}}}, comp_segs::Nothing) @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/main.jl:142 [9] save_segmentation_results(bm_data::Baysor.BmmData{2}, 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}}) @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/main.jl:412 [10] run_cli_main(args::Vector{String}) @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/main.jl:481 [11] run_cli(args::Vector{String}) @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/common.jl:152 [12] run_cli() @ Baysor ~/.julia/packages/Baysor/HvJao/src/cli/common.jl:137 [13] top-level scope @ ~/baysor:3

Am I missing something? Thanks a lot in advance!

sebgoti avatar Jul 29 '22 14:07 sebgoti

Hi there,

I am having the same issue but when running Baysor with a segmentation mask as prior on our cluster with my own data.

I had to build baysor from source, because none of the other options worked on our HPC.

Here is how I built Baysor:

## This script describes how to compile baysor from source for this cluster
wget https://julialang-s3.julialang.org/bin/linux/x64/1.7/julia-1.7.3-linux-x86_64.tar.gz
export PATH=$HOME/julia-1.7.3/bin:$PATH # Or similar depending on your paths

## Inside Julia
julia ## Enter Julia console
> using Pkg
> Pkg.add([PackageSpec(name="UMAP", rev="master"), PackageSpec(url="https://github.com/kharchenkolab/Baysor.git")])
> import Baysor

## Exit julia and run the following
printf "#! /usr/bin/env julia\nimport Baysor: run_cli\nrun_cli()" >> baysor && chmod +x baysor

Baysor succesfully runs and provides segmentation results but does not create the diagnostics and borders html files.

Here is how I ran Baysor:

data_dir="/home/data"
out_dir="/home/out"
baysor run -m 10 -p -x x -y y --gene gene -o $out_dir"/spots_with_prior" $data_dir"/test_sample.csv" $data_dir"/ilastik_mask.tiff"

My error is pretty much the same as @sebgoti and I think it might be related to the Helvetica font in the html output due to this part of the error message:

caused by: MethodError: no method matching initialize_block!(::Makie.Axis; font="Helvetica")

Thanks for looking into this @VPetukhov !

ERROR: LoadError: UndefRefError: access to undefined reference
Stacktrace:
  [1] getproperty
    @ ./Base.jl:42 [inlined]
  [2] show
    @ ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks/axis.jl:1210 [inlined]
  [3] show_delim_array(io::IOContext{IOBuffer}, itr::Tuple{NamedTuple{(:font,), Tuple{String}}, typeof(Makie.initialize_block!), Makie.Axis}, op::Char, delim::Char, cl::Char, delim_one::Bool, i1::Int64, n::Int64)
    @ Base ./show.jl:1244
  [4] show_delim_array
    @ ./show.jl:1229 [inlined]
  [5] show(io::IOContext{IOBuffer}, t::Tuple{NamedTuple{(:font,), Tuple{String}}, typeof(Makie.initialize_block!), Makie.Axis})
    @ Base ./show.jl:1262
  [6] _show_default(io::IOBuffer, x::Any)
    @ Base ./show.jl:413
  [7] show_default
    @ ./show.jl:396 [inlined]
  [8] show
    @ ./show.jl:391 [inlined]
  [9] print(io::IOBuffer, x::MethodError)
    @ Base ./strings/io.jl:35
 [10] print_to_string(::MethodError, ::Vararg{Any})
    @ Base ./strings/io.jl:144
 [11] string(::MethodError, ::String)
    @ Base ./strings/io.jl:185
 [12] macro expansion
    @ ./logging.jl:360 [inlined]
 [13] run_cli(args::Vector{String})
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/cli/common.jl:170
 [14] run_cli()
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/cli/common.jl:137
 [15] top-level scope
    @ ~/bin/baysor:3
in expression starting at /home/hd/hd_hd/hd_gr294/bin/baysor:3

caused by: MethodError: no method matching initialize_block!(::Makie.Axis; font="Helvetica")
Closest candidates are:
  initialize_block!(::Makie.Axis; palette) at ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks/axis.jl:168 got unsupported keyword argument "font"
  initialize_block!(!Matched::Makie.Label) at ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks/label.jl:3 got unsupported keyword argument "font"
  initialize_block!(!Matched::Makie.Textbox) at ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks/textbox.jl:1 got unsupported keyword argument "font"
  ...
Stacktrace:
  [1] kwerr(::NamedTuple{(:font,), Tuple{String}}, ::Function, ::Makie.Axis)
    @ Base ./error.jl:163
  [2] _block(::Type{Makie.Axis}, ::Makie.Figure; bbox::Nothing, kwargs::Base.Pairs{Symbol, Any, NTuple{10, Symbol}, NamedTuple{(:title, :xticksvisible, :yticksvisible, :xticklabelsize, :yticklabelsize, :xlabel, :ylabel, :xlabelpadding, :ylabelpadding, :font), Tuple{String, Bool, Bool, Int64, Int64, String, String, Int64, Int64, String}}})
    @ Makie ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks.jl:403
  [3] #_#999
    @ ~/.julia/packages/Makie/h8AEO/src/makielayout/blocks.jl:279 [inlined]
  [4] plot_num_of_cells_per_iterarion(tracer::Dict{Symbol, Any})
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/data_processing/plots.jl:155
  [5] (::Baysor.var"#329#330"{NamedTuple{(:exprs, :assignment, :diffs, :assignment_probs, :change_fracs), Tuple{Matrix{Float64}, Vector{Int64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}}}, Nothing, DataFrames.DataFrame, Vector{Int64}, Dict{Symbol, Any}})(io::IOStream)
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/cli/main.jl:162
  [6] open(::Baysor.var"#329#330"{NamedTuple{(:exprs, :assignment, :diffs, :assignment_probs, :change_fracs), Tuple{Matrix{Float64}, Vector{Int64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}}}, Nothing, DataFrames.DataFrame, Vector{Int64}, Dict{Symbol, Any}}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:330
  [7] open
    @ ./io.jl:328 [inlined]
  [8] plot_diagnostics_panel(df_res::DataFrames.DataFrame, assignment::Vector{Int64}, tracer::Dict{Symbol, Any}, args::Dict{String, Any}; clust_res::NamedTuple{(:exprs, :assignment, :diffs, :assignment_probs, :change_fracs), Tuple{Matrix{Float64}, Vector{Int64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}}}, comp_segs::Nothing)
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/cli/main.jl:142
  [9] 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}})
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/cli/main.jl:412
 [10] run_cli_main(args::Vector{String})
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/cli/main.jl:481
 [11] run_cli(args::Vector{String})
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/cli/common.jl:152
 [12] run_cli()
    @ Baysor ~/.julia/packages/Baysor/K7Vqu/src/cli/common.jl:137
 [13] top-level scope
    @ ~/bin/baysor:3

FloWuenne avatar Aug 02 '22 06:08 FloWuenne

To put a small update here, I think this issue might be related to different formats of arrays for the plotting based on this julia thread:

https://discourse.julialang.org/t/undefreferror-access-to-undefined-reference/3526/6

I don't write Julia and so can't really do anything to fix this issue at this point.

In my case, the same input data works locally using Docker but gives me this error on our HPC, where I had to build Baysor as a Julia package, so it might be due to some dependency that is in the Docker container but not when the package is built maybe?

Would really appreciate some help with this @VPetukhov.

Issue #46 seems to have the same problem as described here!

FloWuenne avatar Aug 08 '22 15:08 FloWuenne

Hi @VPetukhov , Thanks for all your work on this great tool! Unfortunately I have exactly the same issue as @FloWuenne and some help on how to resolve that would indeed be very much appreciated. Thank you!

Bassi-git avatar Sep 12 '22 12:09 Bassi-git

Please, see the response here: https://github.com/kharchenkolab/Baysor/issues/59 (sorry for the late reaction). Should be fixed in v0.6.0.

VPetukhov avatar Apr 21 '23 07:04 VPetukhov