From 31688450232189f361d0fafd9609a7e9df573da9 Mon Sep 17 00:00:00 2001 From: Luke Zappia Date: Tue, 22 Oct 2024 07:42:57 +0200 Subject: [PATCH] Use proxyC for both distance matrices --- src/metrics/coranking/config.vsh.yaml | 1 - src/metrics/coranking/script.R | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/metrics/coranking/config.vsh.yaml b/src/metrics/coranking/config.vsh.yaml index 89772af..b887dfa 100644 --- a/src/metrics/coranking/config.vsh.yaml +++ b/src/metrics/coranking/config.vsh.yaml @@ -104,7 +104,6 @@ engines: cran: - coRanking - proxyC - - parallelDist runners: - type: executable - type: nextflow diff --git a/src/metrics/coranking/script.R b/src/metrics/coranking/script.R index 5d04fd4..c75eb45 100644 --- a/src/metrics/coranking/script.R +++ b/src/metrics/coranking/script.R @@ -31,10 +31,13 @@ if (any(is.na(X_emb))) { # TODO: should we use a different distance metric for the high_dim? # TODO: or should we subset to the HVG? message("Compute high-dimensional distances") - dist_highdim <- proxyC::dist(high_dim, method = "euclidean") - diag(dist_highdim) <- 0 # Force diagonal to be 0 + dist_highdim <- proxyC::dist( + high_dim, method = "euclidean", diag = TRUE, drop0 = TRUE + ) message("Compute embedding distances") - dist_emb <- parallelDist::parallelDist(as.matrix(X_emb)) + dist_emb <- proxyC::dist( + X_emb, method = "euclidean", diag = TRUE, drop0 = TRUE + ) message("Compute ranking matrices") rmat_highdim <- rankmatrix(dist_highdim, input = "dist")