scverse / scverse/squidpy

`sq.pl.spatial_segment`: wrong cells selected by `groups` parameter

Open
#770 1 comment 0 reactions 1 assignee View on GitHub

@michalk8 is already working on this.

Since Nov 10, 2023.

plot :hibiscus:
Dominant language
Python
Stars
598
Forks
121
Avg merge
3d 11h
Merged PRs (30d)
3

Description

Description

When the groupsparameter is specified in sq.pl.spatial_segment the cells that are plotted are not the cells where adata.obs[color].isin(groups). For example with the mibitof dataset below, when groups = ["Epithelial","Tcell_CD4"] mostly cells on the left side of the image are plotted and these are not the location of these cell types when groups = None.

...

Minimal reproducible example

import squidpy as sq
import anndata as ad

adata = sq.datasets.mibitof()
sq.pl.spatial_segment(adata,seg_cell_id = "cell_id",library_key  = "library_id",
                      color = "Cluster",library_id = "point23")

all_cells

sq.pl.spatial_segment(adata,seg_cell_id = "cell_id",library_key  = "library_id",
                      color = "Cluster",library_id = "point23",
                      groups = ["Epithelial","Tcell_CD4"])

selected_cells

Traceback

No errors raised

Version

1.3.1

...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.