Skip to content

Commit

Permalink
Use proxyC for both distance matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
lazappi committed Oct 22, 2024
1 parent dc3adb6 commit 3168845
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/metrics/coranking/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ engines:
cran:
- coRanking
- proxyC
- parallelDist
runners:
- type: executable
- type: nextflow
Expand Down
9 changes: 6 additions & 3 deletions src/metrics/coranking/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3168845

Please sign in to comment.