I have a problem with sc.pl.spatial() displaying empty figure.
Here is what I did:
So I have 3 outputs from spaceranger: barcodes.tsv.gz, features.tsv.gz, matrix.mtx.gz.
I import them using sc.read_10x_mtx() while passing the folder path.
Then I followed this tutorial: Import spatial data in AnnData and Squidpy — Squidpy main documentation
I got the coordinates that are the last 2 columns of the tissue_positions_list.csv file, which also comes after the run of spaceranger (The file is in spatial folder).
After following the tutorial above I get an empty figure like so, even though I added the coordinates to the obsm: 'spatial':
So I have 3 outputs from spaceranger: barcodes.tsv.gz, features.tsv.gz, matrix.mtx.gz .
you’d also have to read the images and scalefactors in the spatial folder (also output of spaceranger) and put them in the right place in uns (as described in the tutorial you shared or by copying structure in e.g.
import squidpy as sq
adata = sq.datasets.visium_hne_adata()
As mentioned before I have the barcodes.tsv.gz, features.tsv.gz, matrix.mtx.gz and not the .h5 file. I tried to use the squidpy.read.visium() method but it did not work. I get an error asking for .h5.
Just to add, I also tried to plot other data that I know is fine by using the sc.pl.spatial(adata, color="leiden", spot_size=1) and it also gives me an empty plot.
Hello! May I know how you manage to do that without having a .h5 file at the beginning? Did you generate one by yourself? Would you please share your experience? I am also stuck with it as well… Thanks a lot!!
What I basically did was: I created a custom script that puts these individual files and the corresponding spatial folder automatically in an anndata object, which in turn can be saved as h5ad. Since, in my case, after some digging, I’ve noticed some of the file extensions were weird. The file itself was okay.