Skip to content

Rows annotating multiple regions #34

Closed

Description

@LucaMarconato

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.

Activity

  1. ivirshup commented on Oct 11, 2022

    @ivirshup
    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.

  2. LucaMarconato commented on Oct 11, 2022

    @LucaMarconato
    MemberAuthor

    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.

  3. giovp commented on Oct 13, 2022

    @giovp
    Member

    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?

  4. LucaMarconato commented on Feb 2, 2023

    @LucaMarconato
    MemberAuthor

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

  5. LucaMarconato commented on Feb 15, 2023

    @LucaMarconato
    MemberAuthor

    Related #99

  6. LucaMarconato commented on Feb 22, 2024

    @LucaMarconato
    MemberAuthor

    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")
  7. linked a pull request that will close this issuemulti table support #455on Feb 22, 2024
  8. melonora commented on Feb 26, 2024

    @melonora
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions