Skip to content

Baysor Not Running on Windows #185

Closed
@marsdenl

Description

Description

Hey @quentinblampe, here's a recap on the Baysor running issue on Windows System. It seems baysor is not being run properly and hence, no polygons are being generated.

Steps leading to issue on API:

sdata = sopa.io.merscope("Z:/Queries/Data/Batch5_region3/region_3/")
sopa.make_transcript_patches(
sdata,
patch_width=1000,
prior_shapes_key="cell_id",
unassigned_value=-1
)
sopa.segmentation.baysor(sdata, scale=6.25)

AssertionError: Could not find the segmentation polygons file in C:\Users\marsdenl.sopa_cache\12dec02d-0281-4d2c-bd54-dfc887679fea\transcript_patches\0

The equivalent commands on the CLI lead to the same error.

FYI:
sopa.utils.get_cache_dir(sdata)
WindowsPath('C:/Users/marsdenl/.sopa_cache/12dec02d-0281-4d2c-bd54-dfc887679fea')

As you suggested, I tried running baysor individually on one of the generated patches in the cache directory and it did start running but I then got:

baysor run -c config.toml transcripts.csv

[11:18:35] Info: Run R2d01a4d04
[11:18:35] Info: (2025-01-28) Run Baysor v0.7.0
[11:18:35] Info: Loading data...
ERROR: gene column '["g", "e", "n", "e"]' not found in the data frame
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] read_spatial_df(data_path::String; x_col::Symbol, y_col::Symbol, z_col::Symbol, gene_col::Symbol, filter_cols::Bool, drop_z::Bool)
@ Baysor.DataLoading C:\Users\marsdenl.julia\packages\Baysor\gQh5m\src\data_loading\data.jl:62
[3] read_spatial_df
@ C:\Users\marsdenl.julia\packages\Baysor\gQh5m\src\data_loading\data.jl:42 [inlined]
[4] load_df(data_path::String; min_molecules_per_gene::Int64, exclude_genes::Vector{String}, kwargs::@kwargs{x_col::Symbol, y_col::Symbol, z_col::Symbol, gene_col::Symbol, drop_z::Bool, filter_cols::Bool})
@ Baysor.DataLoading C:\Users\marsdenl.julia\packages\Baysor\gQh5m\src\data_loading\data.jl:91
[5] load_df
@ C:\Users\marsdenl.julia\packages\Baysor\gQh5m\src\data_loading\data.jl:90 [inlined]
[6] load_df(coordinates::String, data_opts::Baysor.Utils.DataOptions; kwargs::@kwargs{filter_cols::Bool})
@ Baysor.DataLoading C:\Users\marsdenl.julia\packages\Baysor\gQh5m\src\data_loading\cli_wrappers.jl:204
[7] run(coordinates::String, prior_segmentation::String; config::Baysor.Utils.RunOptions, x_column::Symbol, y_column::Symbol, z_column::Symbol, gene_column::Symbol, min_molecules_per_cell::Int64, scale::Float64, scale_std::String, n_clusters::Int64, prior_segmentation_confidence::Float64, output::String, plot::Bool, polygon_format::String, count_matrix_format::String)
@ Baysor.CommandLine C:\Users\marsdenl.julia\packages\Baysor\gQh5m\src\cli\main.jl:100
[8] run
@ C:\Users\marsdenl.julia\packages\Baysor\gQh5m\src\cli\main.jl:51 [inlined]
[9] command_main(ARGS::Vector{String})
@ Baysor C:\Users\marsdenl.julia\packages\Comonicon\F3QqZ\src\codegen\julia.jl:343
[10] command_main()
@ Baysor C:\Users\marsdenl.julia\packages\Comonicon\F3QqZ\src\codegen\julia.jl:90
[11] top-level scope
@ none:1

The gene column doesn't seem too weird:
transcripts.csv

So I then tried on MacOS. I couldn't transfer a whole sample to MacsOS as I am out of memory so I generated a .zarr file and exported it on my windows system then I downloaded it to my Mac. Once on MasOS, I generated transcript patches and ran baysor on a single patch (all patches would take quite a while) and it seemed to have worked fine. I encountered no errors, although I did not inspect generated polygons (frankly, I did not know where to find them...). Steps on Mac:

sdata = spatialdata.read_zarr("b5_r0.zarr")
sopa.make_transcript_patches(
sdata,
patch_width=1000,
prior_shapes_key="cell_id",
unassigned_value=-1
)
sopa.segmentation.baysor(sdata, scale=6.25, patch_index=2)

Hope this helps a bit! Let me know if anything is unlcear /

System

  • OS: Windows and MacOS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions