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

Use scib.cl.cluster_optimal_resolution in metrics wrapper #405

Merged
merged 4 commits into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions scib/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ..utils import check_adata, check_batch
from .ari import ari
from .cell_cycle import cell_cycle
from .clustering import opt_louvain
from .clustering import cluster_optimal_resolution
from .graph_connectivity import graph_connectivity
from .highly_variable_genes import hvg_overlap
from .isolated_labels import isolated_labels
Expand Down Expand Up @@ -290,16 +290,15 @@ def metrics(

# clustering
if nmi_ or ari_:
res_max, nmi_max, nmi_all = opt_louvain(
res_max, nmi_max, nmi_all = cluster_optimal_resolution(
adata_int,
label_key=label_key,
cluster_key=cluster_key,
metric=nmi,
use_rep=embed,
function=nmi,
plot=False,
verbose=verbose,
inplace=True,
force=True,
verbose=verbose,
return_all=True,
)
if cluster_nmi is not None:
nmi_all.to_csv(cluster_nmi, header=False)
Expand Down
Loading