From aaacd9e8c9e75a8bde91a7efc8d152cdf42580f3 Mon Sep 17 00:00:00 2001 From: Brandon Bergsneider Date: Thu, 10 Aug 2023 14:55:10 -0700 Subject: [PATCH 1/2] Update CellChat_class.R --- R/CellChat_class.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/CellChat_class.R b/R/CellChat_class.R index 852de63..8fd2931 100644 --- a/R/CellChat_class.R +++ b/R/CellChat_class.R @@ -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] images[[images.j]] <- values.new } } @@ -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] images[[images.j]] <- values.new } } @@ -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] 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] net[[net.j]] <- values.new } } From 35e61ebae90cfbb07603f9f1ae9cabc355d8c5bf Mon Sep 17 00:00:00 2001 From: Brandon Bergsneider Date: Thu, 10 Aug 2023 16:24:14 -0700 Subject: [PATCH 2/2] subset-fix-attempt2 --- R/CellChat_class.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/CellChat_class.R b/R/CellChat_class.R index 8fd2931..9332642 100644 --- a/R/CellChat_class.R +++ b/R/CellChat_class.R @@ -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 } } @@ -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 } } @@ -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 } }