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

Subset fix attempt2 #668

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions R/CellChat_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ subsetCellChat <- function(object, cells.use = NULL, idents.use = NULL, group.by
images[[images.j]] <- values.new
}
if (images.j %in% c("distance")) {
values.new <- values[group.existing.index, group.existing.index, drop = FALSE]
values.new <- values[group.existing.index, group.existing.index, drop = FALSE] #line 743
images[[images.j]] <- values.new
}
}
Expand Down Expand Up @@ -812,7 +812,7 @@ subsetCellChat <- function(object, cells.use = NULL, idents.use = NULL, group.by
images[[images.j]] <- values.new
}
if (images.j %in% c("distance")) {
values.new <- values[group.existing.index, group.existing.index, drop = FALSE]
values.new <- values[group.existing.index, group.existing.index, drop = FALSE] #line 815
images[[images.j]] <- values.new
}
}
Expand All @@ -824,11 +824,11 @@ subsetCellChat <- function(object, cells.use = NULL, idents.use = NULL, group.by
for (net.j in names(net)) {
values <- net[[net.j]]
if (net.j %in% c("prob","pval")) {
values.new <- values[group.existing.index, group.existing.index, drop = FALSE]
values.new <- values[group.existing.index, group.existing.index, ,drop = FALSE] #line 827
net[[net.j]] <- values.new
}
if (net.j %in% c("count","sum","weight")) {
values.new <- values[group.existing.index, group.existing.index, drop = FALSE]
values.new <- values[group.existing.index, group.existing.index, drop = FALSE] #line 831
net[[net.j]] <- values.new
}
}
Expand Down