Closed pakiessling closed 8 months ago
Hello @pakiessling,
I never saw this error, it is very surprising. I think you can open an issue on the Baysor repository, because the command line executed by snakemake looks very normal.
Or maybe just one thing: can you check that the directory /hpcwork/rwth1209/data/merfish/processed/53-ES-500-HuHeart-E3279/region_0.zarr/.sopa_cache/baysor_boundaries/77
looks normal? It should contain a transcripts.csv
file, and a config.toml
file (can you have a quick look to see if something feels wrong?).
I'm also using the version 0.6.2 of Baysor, and everything works well when running sopa on MERSCOPE data with the same config as you.
Concerning the patch_width_microns
and patch_overlap_microns
parameters: they are used to create the patches on which baysor will be run. That is, we create patches of 1000 microns (width and height), and the patches will have an overlap of 20 microns; then, we will run Baysor once per patch. You can keep these parameters like this! If you increase patch_width_microns
, you'll have less patches, and therefore have less Baysor runs, but each run will require more RAM (so you could optionnally change patch_width_microns
to find a better balance depending on your cluster capacity).
I'm sorry to see that you experience all these issues, I hope it will be fixed quickly :)
I think I found the reason. Scale and scale std somehow get set to negative values. I think this might be caused by me removing these parameters from the Baysor section of the config. It is a bit confusing as these parameters should not be necessary when suppliyng a prior segmentation as in the case of the Merfish on board segmentation.
My config file looks like this:
# For parameters details, see this commented example: https://github.com/gustaveroussy/sopa/blob/master/workflow/config/example_commented.yaml
read:
technology: merscope
patchify:
patch_width_pixel: 6000
patch_overlap_pixel: 150
patch_width_microns: 1000
patch_overlap_microns: 20
segmentation:
baysor:
cell_key: cell_id
unassigned_value: -1
config:
data:
exclude_genes: "Blank*" # genes excluded from the Baysor segmentation
force_2d: true # if false, uses 3D mode
min_molecules_per_cell: 10 # min number of transcripts per cell
x: "x"
y: "y"
z: "z"
gene: "gene"
min_molecules_per_gene: 0
min_molecules_per_segment: 3
confidence_nn_id: 6
segmentation:
prior_segmentation_confidence: 0.8 # confidence of the cellpose confidence (float in [0, 1])
estimate_scale_from_centers: false
n_clusters: 4
iters: 500
n_cells_init: 0
nuclei_genes: ""
cyto_genes: ""
new_component_weight: 0.2
new_component_fraction: 0.3
aggregate:
annotation:
method: tangram
args:
sc_reference_path: /hpcwork/rwth1209/data/scRNA/reference_datasets/celltypist_heart_no_atrial.h5ad
cell_type_key: cell_type
reference_preprocessing: log1p
explorer:
gene_column: "gene"
ram_threshold_gb: 16
pixelsize: 0.108
executables:
baysor: /rwthfs/rz/cluster/work/rwth1209/software/baysor/baysor-x86_x64-linux-v0.6.2_build/bin/baysor/bin/baysor
I want to segment with Baysor and use the Merscope segmentation as prior. Does anything jump out to you?
Also no reason to apologize, I hope I am not being annoying with the Issues.
Indeed it may be because of removing scale
and scale_std
. I always keep these parameters, even when I'm using a prior segmentation (actually, I didn't know these parameters were optional when supplying a prior segmentation). Maybe you can try to set back scale: 6.25
and scale_std: "25%"
to see if it works?
For the rest of the config, everything looks good to me!
No don't worry, I'm really happy to help, and also very happy to see that some people are already using Sopa 👍
Hi,
I am trying to run the Snakemake pipeline with Baysor. Unfortunately all my Baysor jobs fail like the following:
Have you ever seen this before? Is there a specific Baysor version I should use? I am on 0.6.2
I also didnt change these settings:
Do these need to be optimized per tissue or do they depend on the patchify settings?
I am also not entirely clear on
My pixelsize is 0.108 do I need to adjust this?