A problem when using netVisual_aggregate
Hi, Thanks for developing this user-friendly tool. I have problem when I run the code follow:
netVisual_aggregate(cellchat, signaling = pathways.show, vertex.receiver = c(1,2,3,5), vertex.size = groupSize)
I get this picuture follow:

when I try to save it in local,I get this error and picuture follow:
Error in text.default(x, y, labels = labels, col = label.color, family = label.family, : invalid font type

It seems that some problems are related with igraph.
Can you kindly help me with this problem? Thank you very much!
@chuiqin Try install.packages("extrafont")
Thank you very much for your help!
@chuiqin Try
install.packages("extrafont")I'm sorry but I still get the same error after installing packages("extrafont").
Error in text.default(x, y, labels = labels, col = label.color, family = label.family, : invalid font type
Can you help me with this problem again? Thank you!
@chuiqin It looks like your R does not support 'Arial' font style when doing plotting. Can you google such issue based on your system of the computer as I did not hear of such issue from other users? The extrafont package is available here. In addition, please try save the plot using svglite(file ="a.pdf")...dev.off()
@chuiqin It looks like your R does not support 'Arial' font style when doing plotting. Can you google such issue based on your system of the computer as I did not hear of such issue from other users? The extrafont package is available here. In addition, please try save the plot using
svglite(file ="a.pdf")...dev.off()
Thank you very much! You're right! When I change my code: `library(svglite)
svglite(file = "pathway.svg", width=10, height=10)
netVisual_aggregate(cellchat, signaling = pathways.show, vertex.receiver = c(1,2,3,5), vertex.size = groupSize) dev.off()` It‘s surperised that the picture can created correctly! Thank you very much for your help again!
Well, I got this error again .I have no idea about that how can I save the picture with the pdf format. who can help me ?
@wuzhigui Have you tried svglite(file ="a.pdf")...dev.off() or saving as .svg file?
Hi, This error generally occurs when non-standard fonts like Arial or Times New Roman are not available in your R session. (This has been mentioned before https://github.com/sqjin/CellChat/issues/29#issuecomment-677048306) I was able to fix this as follows (Ubuntu):
- Download TTF files for font Arial and Times New Roman, e.g. from here.
- Unzip the files and put them into a reasonable directory, e.g.
/home/USERNAME/fonts. - Install the R extrafont package, and add the following code to the header of your script:
library(extrafont)
font_import(paths="/home/USERNAME/fonts", prompt=F)
loadfonts(device = "pdf", quiet = F)
- Run the code to generate PDF figures, for example:
pdf("/home/USERNAME/CellChat_results/network.pdf", width=7, height=7)
netVisual_aggregate(cellchat, signaling = pathways.show, vertex.receiver = vertex.receiver, vertex.size = groupSize)
dev.off()
Worked like a charm for me. Cheers.
Hi @Xethic , thank you so much for sharing this!
I can't use netVisual_aggregate to get the graphics I want。I hope to get the following figure:
However, I always get such a circle

Can you help me, thank you~
@Aby-GGG You should set 'layout = "hierarchy"'.
Thank you very much. This problem has been solved. But I can't draw a green ligand map with the following code.Can you help me, thank you~
cellchat <- netAnalysis_computeCentrality(cellchat,slot.name = "netP") # the slot 'netP' means the inferred intercellular communication network of signaling pathways pdf("5.pdf", width=6, height=6) netAnalysis_computeCentrality(cellchat, signaling = pathways.show, width = 12, height = 2.5, font.size = 10) dev.off()
cellchat <- netAnalysis_signalingRole(cellchat,slot.name = "netP") # the slot 'netP' means the inferred intercellular communication network of signaling pathways pdf("5.pdf", width=6, height=6) netAnalysis_signalingRole(cellchat, signaling = pathways.show, width = 12, height = 2.5, font.size = 10) dev.off()
------------------ 原始邮件 ------------------ 发件人: "sqjin/CellChat" @.>; 发送时间: 2022年2月18日(星期五) 晚上7:59 @.>; @.@.>; 主题: Re: [sqjin/CellChat] A problem when using netVisual_aggregate (#18)
@Aby-GGG You should set 'layout = "hierarchy"'.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>
This function can't draw a graph and always displays "could not find function" netAnalysis_signalingRole " "netAnalysis_computeCentrality " and "netAnalysis_signalingRole_network" can't figure out either。I want to get the following graphics
Can you help me, thank you~
Thank you very much. This problem has been solved. But I can't draw a green ligand map with the following code.Can you help me, thank you~
cellchat <- netAnalysis_computeCentrality(cellchat,slot.name = "netP") # the slot 'netP' means the inferred intercellular communication network of signaling pathways pdf("5.pdf", width=6, height=6) netAnalysis_computeCentrality(cellchat, signaling = pathways.show, width = 12, height = 2.5, font.size = 10) dev.off()
cellchat <- netAnalysis_signalingRole(cellchat,slot.name = "netP") # the slot 'netP' means the inferred intercellular communication network of signaling pathways pdf("5.pdf", width=6, height=6) netAnalysis_signalingRole(cellchat, signaling = pathways.show, width = 12, height = 2.5, font.size = 10) dev.off()
------------------ 原始邮件 ------------------ 发件人: "sqjin/CellChat" @.>; 发送时间: 2022年2月18日(星期五) 晚上7:59 @.>; @.@.>; 主题: Re: [sqjin/CellChat] A problem when using netVisual_aggregate (#18)
@Aby-GGG You should set 'layout = "hierarchy"'.
— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>