diff --git a/src/harmony/core.py b/src/harmony/core.py index 37034a0..14a295a 100644 --- a/src/harmony/core.py +++ b/src/harmony/core.py @@ -65,7 +65,11 @@ def augmented_affinity_matrix( temp = sc.AnnData(data_df.values) sc.pp.neighbors(temp, n_pcs=0, n_neighbors=n_neighbors) - kNN = temp.uns['neighbors']['distances'] + # maintaining backwards compatibility to Scanpy `sc.pp.neighbors` + try: + kNN = temp.uns['neighbors']['distances'] + except KeyError: + kNN = temp.obsp['distances'] # Adaptive k adaptive_k = int(np.floor(n_neighbors / 3)) diff --git a/src/harmony/version.py b/src/harmony/version.py index ae73625..bbab024 100644 --- a/src/harmony/version.py +++ b/src/harmony/version.py @@ -1 +1 @@ -__version__ = "0.1.3" +__version__ = "0.1.4"