Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Fix the error in netVisual_embeddingPairwise
Browse files Browse the repository at this point in the history
  • Loading branch information
sqjin authored Nov 3, 2022
1 parent c982c71 commit 9e1e605
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -3237,7 +3237,7 @@ netVisual_embeddingPairwise <- function(object, slot.name = "netP", type = c("fu
if (is.null(pathway.remove)) {
similarity <- methods::slot(object, slot.name)$similarity[[type]]$matrix[[comparison.name]]
pathway.remove <- rownames(similarity)[which(colSums(similarity) == 1)]
pathway.remove <- sub("--.*", "", pathway.remove)
# pathway.remove <- sub("--.*", "", pathway.remove)
}

if (length(pathway.remove) > 0) {
Expand Down Expand Up @@ -3353,13 +3353,14 @@ netVisual_embeddingPairwiseZoomIn <- function(object, slot.name = "netP", type =
if (is.null(pathway.remove)) {
similarity <- methods::slot(object, slot.name)$similarity[[type]]$matrix[[comparison.name]]
pathway.remove <- rownames(similarity)[which(colSums(similarity) == 1)]
pathway.remove <- sub("--.*", "", pathway.remove)
# pathway.remove <- sub("--.*", "", pathway.remove)
}

if (length(pathway.remove) > 0) {
for (i in 1:length(prob)) {
probi <- prob[[i]]
pathway.remove.idx <- which(dimnames(probi)[[3]] %in% pathway.remove)
pathway.remove.idx <- which(paste0(dimnames(probi)[[3]],"--",object.names[i]) %in% pathway.remove)
# pathway.remove.idx <- which(dimnames(probi)[[3]] %in% pathway.remove)
if (length(pathway.remove.idx) > 0) {
probi <- probi[ , , -pathway.remove.idx]
}
Expand Down

0 comments on commit 9e1e605

Please sign in to comment.