-
Notifications
You must be signed in to change notification settings - Fork 17
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
Problem with substituting sdata.table with external AnnData #293
Comments
Hi, thanks for your interest in the library. Please you can find an extended discussion on how to add additional annotation layers in the In your case, you can adjust the metadata via Please let me know if you have still question on this. |
Hi Luca, thanks for your precious support. With Below is the code I used. It's all pretty much straightforward, except for the helper function I wrote from scratch to prepare the table for the visualization.
|
UPDATE: I noticed that every time I select a different annotation in
In my mind, this just confirms the idea that the problem resides in the colormap. The question is: can I manually set the I found a very similar PR in the github of BiAPoL, who developed a |
Thanks for the update @gboscagli and for the hint that the problem could be related to the colormap in napari. To make it easier to investigate this, could you please reproduce the bug using this dataset: from spatialdata.datasets import blobs
sdata = blobs() You can also use from spatialdata.datasets import blobs_annotating_element
sdata = blobs_annotating_element('blobs_labels') Thank you! |
Hi @LucaMarconato,
I think @melonora is aware of this, as we spoke about the same problem in an Image.sc issue. With my public By now, I circumvented the problem by saving Could it depend on the dtype of the columns I'm trying to plot? They actually come from a |
Yes in principle it could depend on the dtype.
which is the other tracked issue? I could have a look if helpful. Regarding the reproducible example, if I got it right you couldn't reproduce the bug with the @melonora is unfortunately currently unavailable/with limited capacity for the next two weeks because of a pressing deadline. |
I haven't opened it yet. Basically, when I plot an obs annotation, a color is not "unique" for a certain discrete value. To be clearer, in the following image, pinkish cells can refer to several different annotations. Also, an annotation can be found with more than one color (i.e., a mural cell could be either pink or another color). I'm quite sure it is a Colormap problem, but I don't know how could be related to the original issue.
The dataset is public (link above), I could just send my annotated |
Sounds great!
|
Where do you prefer the .h5ad file to be sent?
I will check the PR and keep you updated. |
Via Zulip thanks: https://scverse.zulipchat.com/#user/480560
sounds great, please if there are further comments on it let's follow up on a dedicated GitHub Issue. |
UPDATE: I found out that the problem resided somewhere in my external I'm closing this! |
Hi all,
I'm starting to use
SpatialData
framework but I'm still missing something.I'm working on this public CosMx dataset. I'm able to read it as a
SpatialData
object and to visualize it usingNapari
, annotations included. However, I have done previous work on the same dataset and stored some annotations (louvain clusters, cell type annotations, etc...) in anAnnData
object. At a first glance, I naively tried to substitute sdata.table with myAnnData
(I saw you "recommended" it in scverse/spatialdata#270): it kinda works, except for the fact that when opened inNapari
the table isn't recognized anymore in the "Tables annotating layer" menu, and thus I'm not able to plot any annotation. Maybe some references and metadata linking labels to annotations got lost during the transition: I thought of the missingregion
,region_key
andinstance_key
metadata, but they are missing from theSpatialData
table too. For the moment, I worked around it by concatenating specific columns fromAnnData
toSpatialData
table, but I don't think this is the ideal solution. I also guess that adding myAnnData
as additional table wouldn't solve my problem.Do you have some recommendations for my issue?
The text was updated successfully, but these errors were encountered: