Skip to content

Commit 18108ca

Browse files
committed
use graph connectivity for scanorama
1 parent ea9cb05 commit 18108ca

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

tests/integration/test_scanorama.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,9 @@ def test_scanorama(adata_paul15_template):
1111
adata, n_top_genes=200, neighbors=True, use_rep="X_emb", pca=True, umap=False
1212
)
1313

14-
# check NMI after clustering
15-
res_max, score_max, _ = scib.cl.cluster_optimal_resolution(
16-
adata,
17-
label_key="celltype",
18-
cluster_key="cluster",
19-
use_rep="X_emb",
20-
return_all=True,
21-
)
22-
LOGGER.info(f"max resolution: {res_max}, max score: {score_max}")
23-
24-
assert_near_exact(score_max, 0.6610082444492823, 1e-2)
14+
score = scib.me.graph_connectivity(adata, label_key="celltype")
15+
LOGGER.info(f"score: {score}")
16+
assert_near_exact(score, 0.9922324725135062, 1e-2)
2517

2618

2719
def test_scanorama_batch_cols(adata_paul15_template):

tests/integration/test_scanvi.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import scib
2-
from tests.common import assert_near_exact
2+
from tests.common import LOGGER, assert_near_exact
33

44

55
def test_scanvi(adata_paul15_template):
@@ -12,4 +12,5 @@ def test_scanvi(adata_paul15_template):
1212
)
1313

1414
score = scib.me.graph_connectivity(adata, label_key="celltype")
15+
LOGGER.info(f"score: {score}")
1516
assert_near_exact(score, 1.0, 1e-1)

tests/integration/test_scvi.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import scib
2-
from tests.common import assert_near_exact
2+
from tests.common import LOGGER, assert_near_exact
33

44

55
def test_scvi(adata_paul15_template):
@@ -10,4 +10,5 @@ def test_scvi(adata_paul15_template):
1010
)
1111

1212
score = scib.me.graph_connectivity(adata, label_key="celltype")
13+
LOGGER.info(f"score: {score}")
1314
assert_near_exact(score, 0.96, 1e-1)

0 commit comments

Comments
 (0)