Skip to content

Commit

Permalink
Use scib.cl.cluster_optimal_resolution in metrics wrapper (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
mumichae committed Apr 17, 2024
1 parent 2d9ec16 commit 127e41e
Showing 1 changed file with 5 additions and 6 deletions.
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

0 comments on commit 127e41e

Please sign in to comment.