scverse / squidpy

Spatial Single Cell Analysis in Python
https://squidpy.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
401 stars 72 forks source link

sq.pl.spatial_scatter produces blank plot #752

Closed wdg118 closed 9 months ago

wdg118 commented 9 months ago

Description

sq.pl.spatial_scatter is giving me a blank plot for my MERFISH data although it has the leiden cluster colours on the side as a legend. It has worked for previous MERFISH data. It does not throw an error and traceback. I just wanted to know what can cause this.

Minimal reproducible example

    adata,
    color="leiden",
    library_id = 'library',
    shape=None,
    size=10,
    img=False,
    dpi=100,
    figsize=[8,8],

)
...

Version

Squidpy version: 1.2.0

I need to use this version as I'm using other packages which require an older version.

...

jdime commented 9 months ago

@wdg118 - did you find how to fix your issue?

I'm not sure if this is your case, but I had the same issue and it turned out that the barcode identifiers in the *h5 file that I used to create the adata, and the spatial/tissue_positions.csv were different. The barcodes in the adata had a sample prefix which was missing in the tissue_positions.csv. Maybe check that.

giovp commented 9 months ago

agree it might be due to the fact that the file has been read incorrectly

wdg118 commented 9 months ago

Still have not fixed it. Odd behaviour. This is how I read it in:

adata = sc.read('061023_annotated_target_data.h5ad')

I'm not sure where the problem is since I also don't get an error message and traceback.

giovp commented 9 months ago

yeah that unfortunately doesn't say much cause it depends on how the anndata was built, without access to the original data it's difficult to give any suggestion. WIll close this for now, as it seems a data related issue and maybe it's better to be asked in https://discourse.scverse.org/