CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

Error in netVisual_heatmap when remove.isolate = TRUE

Open siefejo1 opened this issue 3 years ago • 0 comments

Great package! I noticed a small error in the netVisual_heatmap function when remove.isolate = TRUE. It is caused by a duplicate removal of the idx in the following code snippet:

if (remove.isolate) {
    idx1 <- which(Matrix::rowSums(net) == 0)
    idx2 <- which(Matrix::colSums(net) == 0)
    idx <- intersect(idx1, idx2)
    net <- net[-idx, ]
    net <- net[, -idx]
    if (length(idx) > 0) {
      net <- net[-idx, ]
      net <- net[, -idx]
    }
  }

siefejo1 avatar Sep 12 '22 20:09 siefejo1