jinworks / CellChat

R toolkit for inference, visualization and analysis of cell-cell communication from single-cell and spatially resolved transcriptomics
GNU General Public License v3.0
241 stars 34 forks source link

Plot few interactions (not all) in a signalling pathway using netVisual_chord_gene #198

Open shabs24 opened 1 month ago

shabs24 commented 1 month ago

I am trying to plot two interactions (COL4A1_ITGA9_ITGB1, COL1A1_CD44)using netVisual_chord_gene. I only want to show these two interactions only. Here is the code below cellchat@netP$pathways pathways.show <- c("COLLAGEN") cellchat <- aggregateNet(cellchat,signaling = pathways.show) pairLR.use <- extractEnrichedLR(cellchat, signaling = "COLLAGEN", geneLR.return = FALSE) pairLR.use interaction_name 1 COL1A1_ITGA9_ITGB1 2 COL1A2_ITGA9_ITGB1 3 COL4A1_ITGA9_ITGB1 4 COL4A2_ITGA9_ITGB1 5 COL4A5_ITGA9_ITGB1 6 COL6A3_ITGA9_ITGB1 7 COL1A1_CD44 8 COL1A2_CD44 9 COL4A1_CD44 10 COL4A2_CD44 11 COL4A5_CD44 12 COL6A3_CD44

LR.show <- data.frame(pairLR.use [c(1,7),]) netVisual_chord_gene(cellchat, pairLR.use =LR.show, sources.use = c(1,2,3,4), targets.use = 1, legend.pos.y = 30)

This ends up showing interaction in all the pathways. Am I doing something wrong? Is this possible and a way to do it.

If yes, please can you share the code.

Thanks in advance.

sqjin commented 1 month ago

@shabs24 This function works, but you did not use it correctly. You can do as follows: LR.show <- pairLR.use[c(1,7),, drop = FALSE]

shabs24 commented 1 month ago

Thanks for the quick response. It works but it only shows one interaction (see plot below). It should show the interaction of Col1a1 to Cd44 and Itga9_Itgb. example.pdf It also gives a message "You may try the function netVisual_chord_cell for visualizing individual signaling pathway"

Jaimelan commented 1 month ago

I have that exact same situation in which some interactions exists in the nalysis but are not plotted

aspides-js commented 3 weeks ago

@shabs24 @Jaimelan This may help: https://github.com/sqjin/CellChat/issues/266 !