CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

Using "pairLR.use" in netVisual_chord_gene()

Open ikarus97 opened this issue 9 months ago • 3 comments

I've been trying to specify the LR pair to be visualized using netVisual_chord_gene(), but kept getting errors: "pairLR.use should be a data frame with a signle column named either 'interaction_name' or 'pathway_name'", even when I provided the proper data frame with single column 'interaction_name'.

In the source code, the part that checks the column names seems to have a misplaced closing ")"

if (!is.data.frame(pairLR.use) | sum(c("interaction_name","pathway_name") %in% colnames(pairLR.use) == 0)) {
      stop("pairLR.use should be a data frame with a signle column named either 'interaction_name' or 'pathway_name' ")
    }

should be

if (!is.data.frame(pairLR.use) | sum(c("interaction_name","pathway_name") %in% colnames(pairLR.use)) == 0) {
      stop("pairLR.use should be a data frame with a signle column named either 'interaction_name' or 'pathway_name' ")
    }

Can you check this part and update it in a future release?

Thank you!

ikarus97 avatar Mar 07 '25 23:03 ikarus97

@ikarus97 Thank you! It was updated now.

sqjin avatar Mar 16 '25 08:03 sqjin

I tried v 2.1.2 and v 2.2.0 and the bug seems to persist https://github.com/jinworks/CellChat/blob/346fb615aaefa3c1a2830ec2fe3a933c5f723c83/R/visualization.R#L2848

flde avatar Apr 29 '25 09:04 flde

Any reason why this PR is not merged yet, @sqjin ?

Would be nice to see this bug fixed.

noxthot avatar Nov 03 '25 22:11 noxthot