Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help please] Integrate multiple spatial transcriptomics datasets is not working! #302

Open
MatteoRiva95 opened this issue Jul 2, 2024 · 1 comment

Comments

@MatteoRiva95
Copy link

Hello everyone,

I am trying to follow this tutorial page:

https://stlearn.readthedocs.io/en/latest/tutorials/Integration_multiple_datasets.html

But when I plot the adata_concat, it returns this image:

image

Something is wrong: as you can see, the right image is decentrated. I suppose this command from the tutorial is the issue:

adata_concat.obs.loc[adata_concat.obs.batch == "1","imagecol"] = adata_concat.obs.loc[adata_concat.obs.batch == "1","imagecol"].values + 2000

How can I be sure that 2000 is fine and not 3000? What number should I use for my dataset then? How can I be certain that it is right for my spatial dataset?

Can you help me please? Thank you so much in advance!

@MatteoRiva95
Copy link
Author

UPDATE:

In order to partially solve the previous issue, I tried not to use the images of the tissue:

block_1 = st.create_stlearn(count=count_matrix_1,spatial=spatial_1,library_id="OSR_IBD_1_A1", scale=1,background_color="white")
block_2 = st.create_stlearn(count=count_matrix_2,spatial=spatial_2,library_id="OSR_IBD_2_B2", scale=1,background_color="white")

adata_concat = block_1.concatenate(block_2)

But if I try to plot a gene with these commands:

plot = st.pl.gene_plot(adata_concat, gene_symbols="MMP3", size = 7.0)
plt.show(plot)

It returns this error:

plot = st.pl.gene_plot(adata_concat, gene_symbols="MMP3", size = 7.0)
Traceback (most recent call last):
File "", line 1, in
File "/home/mriva/.conda/envs/stlearn/lib/python3.8/site-packages/stlearn/plotting/gene_plot.py", line 73, in gene_plot
GenePlot(
File "/home/mriva/.conda/envs/stlearn/lib/python3.8/site-packages/stlearn/plotting/classes.py", line 273, in init
super().init(
File "/home/mriva/.conda/envs/stlearn/lib/python3.8/site-packages/stlearn/plotting/classes.py", line 62, in init
super().init(
File "/home/mriva/.conda/envs/stlearn/lib/python3.8/site-packages/stlearn/classes.py", line 44, in init
self.spot_size = _check_spot_size(self.spatial_data, spot_size)
File "/home/mriva/.conda/envs/stlearn/lib/python3.8/site-packages/stlearn/utils.py", line 41, in _check_spot_size
raise ValueError(
ValueError: When .uns['spatial'][library_id] does not exist, spot_size must be provided directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant