Skip to content

Pass embed through to LISI scores in metrics() - #437

Open
barlowa124 wants to merge 1 commit into
theislab:mainfrom
barlowa124:lisi-embed-rep-429
Open

barlowa124 wants to merge 1 commit into
theislab:mainfrom
barlowa124:lisi-embed-rep-429

Conversation

@barlowa124

Copy link
Copy Markdown

Fixes #429.

metrics() accepts embed (default "X_pca") and forwards it to every
representation-dependent score except LISI: clisi_graph and
ilisi_graph were called without use_rep and always fell back to
their own "X_emb" default. When embed is anything other than
"X_emb", including the documented default, the kNN for LISI is
rebuilt on a different representation than the caller asked for.
Nothing warned.

Both calls now pass use_rep=embed, matching how embed is already
forwarded to cluster_optimal_resolution, silhouette, pc_comparison,
isolated_labels, kBET and cell_cycle in the same function.

The regression test builds a small AnnData carrying X_custom and no
X_emb, then calls metrics(embed="X_custom", clisi_=True, ilisi_=True).
Before the fix it fails looking for X_emb. Afterwards both LISI scores
are finite. black reports both files clean.

AI-assisted (Devin).

clisi_graph and ilisi_graph default to use_rep='X_emb', so metrics()
computed LISI scores on X_emb regardless of the embed argument
(default 'X_pca'). Fixes theislab#429.
@barlowa124

Copy link
Copy Markdown
Author

Closing and reopening to retrigger CI. The earlier run was canceled while building the louvain wheel during dependency install, before any tests ran.

@barlowa124 barlowa124 closed this Nov 12, 2026
@barlowa124 barlowa124 reopened this Nov 12, 2026

This branch has not been deployed

No deployments
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 this pull request may close these issues.

Bug in scib.metrics.metrics when param 'embed' is not default "X_emb" for lisi scores and how to fix it

1 participant