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

Rows annotating multiple regions #34

Closed
LucaMarconato opened this issue Oct 10, 2022 · 7 comments · Fixed by #455
Closed

Rows annotating multiple regions #34

LucaMarconato opened this issue Oct 10, 2022 · 7 comments · Fixed by #455

Comments

@LucaMarconato
Copy link
Member

In the nanostring_cosmx dataset each row of the annotation matrix is associated to two regions, since each set of cells is saved both as a Labels and as a Points (with variable radius for the cells).

With the current specification each row of the table can annotate only one regions, I think we should support the above case, we have to explore how.

@ivirshup
Copy link
Member

So they have two representations for the same regions? How common is that?

I think I'd be fine with making the metadata basically act as default arguments, then letting people specify they want to use a different region set with arguments.

@LucaMarconato
Copy link
Member Author

It actually will be very common when building graphs on top of labels, since you would have points (with the graph in obsp) for the same regions, and you may want to plot sometimes the labels in the background and sometimes the points.

Possible workaround following your suggestion: if the column corresponding to regions_key(the one that for each row of the annotation matrix has a reference to a Regions object) is a numerical index instead of the full path, then the user (or our methods) could quickly switch the target regions by simply modifying the values of regions.

@giovp
Copy link
Member

giovp commented Oct 13, 2022

It actually will be very common when building graphs on top of labels, since you would have points (with the graph in obsp) for the same regions, and you may want to plot sometimes the labels in the background and sometimes the points.

Possible workaround following your suggestion: if the column corresponding to regions_key(the one that for each row of the annotation matrix has a reference to a Regions object) is a numerical index instead of the full path, then the user (or our methods) could quickly switch the target regions by simply modifying the values of regions.

mmh think using indexes rather than explicit values would be tricky. What about using multiple regions_key and instances_key?

@LucaMarconato
Copy link
Member Author

I proposed a solution here: ome/ngff#64 (comment)

@LucaMarconato
Copy link
Member Author

Related #99

@LucaMarconato
Copy link
Member Author

This is solved by the new multi-table PR #455. We don't allow to annotate multiple elements, but we have an helper function to quickly choose what the table is annotating:

full_sdata.set_table_annotates_spatialelement("table", "poly")

@LucaMarconato LucaMarconato linked a pull request Feb 22, 2024 that will close this issue
@melonora
Copy link
Collaborator

Just for completeness, you could potentially add now also two tables, one annotating Points and one annotating Labels. Ofcourse the solution which @LucaMarconato mentions would be better.

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

Successfully merging a pull request may close this issue.

4 participants