spacemake
spacemake copied to clipboard
Error in detect_tissue: setting an array element with a sequence
Hi, Thanks for the great package. I was running spacemake with visium data, and got an exception:
rule run_automated_analysis: input: projects/visium_demo/processed_data/DSG_Control/illumina/complete_data/dge/dge.exon.polyA_adapter_trimmed.mm_included.spatial_beads_visium.h5ad output: projects/visium_demo/processed_data/DSG_Control/illumina/complete_data/automated_analysis/visium/umi_cutoff_1000/DSG_Control_visium_results.h5ad jobid: 47 wildcards: project_id=visium_demo, sample_id=DSG_Control, data_root_type=complete_data, downsampling_percentage=, run_mode=visium, umi_cutoff=1000, puck_barcode_file_id_qc=visium
Rscript --vanilla -e 'rmarkdown::render("/fakepath/openst_test_20240924/result/spacemake_20241021/.snakemake/scripts/tmpd9cfk6th.qc_sequencing_create_sheet.Rmd", output_file="/fakepath/openst_test_20240924/result/spacemake_20241021/projects/visium_demo/processed_data/DSG_Control/illumina/complete_data/qc_sheets/qc_sheet_DSG_Control_visium.html", quiet=TRUE, knit_root_dir = "/fakepath/openst_test_20240924/result/spacemake_20241021", params = list(rmd="/fakepath/openst_test_20240924/result/spacemake_20241021/.snakemake/scripts/tmpd9cfk6th.qc_sequencing_create_sheet.Rmd"))' /fakepath/software/miniconda3/envs/spacemake/bin/python3.10 /fakepath/openst_test_20240924/result/spacemake_20241021/.snakemake/scripts/tmprifp4gew.automated_analysis.py
Finished job 61.
22 of 39 steps (56%) done
Traceback (most recent call last):
File "/fakepath/openst_test_20240924/result/spacemake_20241021/.snakemake/scripts/tmprifp4gew.automated_analysis.py", line 19, in
Then I checked the code in spacemake.spatial.utils.detect_tissue: https://github.com/rajewsky-lab/spacemake/blob/9ce7d8905a8402f2115ec22ea7890fa64b81fe84/spacemake/spatial/util.py#L139
ChatGPT says this should be:
islands_array = np.array(islands, dtype=object)
max_index = np.argmax(island_sizes)
tissue_islands = np.delete(islands_array, max_index)
tissue_islands = tissue_islands.tolist()
I'm using spacemake 0.7.9 with numpy 1.26.4. Is that correct? Thanks in advance.