Skip to content

query.bounding_box not cropping the table #992

Open

Description

@PerrineGilloteaux

The code print(sdata)
print(sdata.tables['table'])
def crop(sdata):
return sdata.query.bounding_box(
min_coordinate=[2000, 2000], max_coordinate=[2200, 2200], axes=("x", "y"), target_coordinate_system="global"
)

print()
csdata=crop(sdata)
print(csdata)

does not return any error, but the cropped csdata does not have a table, and does not return any warning message

The function works well with the blob example dataset. What can I miss ? I do have spatial keys in my adata obsm. Thanks for your help!

Activity

  1. LucaMarconato commented on Dec 29, 2025

    @LucaMarconato
    Member

    Spatial keys are ignored by adata osbm in spaitaldata as it was a legacy from squidpy (we may change this). In your case it seems that the table is not linked to the spatial observation. Can you plot features from the table on the shapes?

    To help understand the issue please provide more information on the SpatialData object and ideally a copy-pasteable reproducible example.

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