sqjin / cellchat Goto Github PK
View Code? Open in Web Editor NEWR toolkit for inference, visualization and analysis of cell-cell communication from single-cell data
License: GNU General Public License v3.0
R toolkit for inference, visualization and analysis of cell-cell communication from single-cell data
License: GNU General Public License v3.0
Hello,
Thank you for developing this wonderful tool!
I have two questions -
The first is, when I got the hierarchical plot to work, it worked beautifully. Then all of a sudden, despite the fact that I'm running the same code (after I've changed pathways.show to a different pathway), the graph looks like this and no longer plots the lines.
The second is, I'd like to specify the clusters used as vertex.receiver.
I've tried vertex.receiver = c(0, 1, 3, 5, 6, 11). I've also tried vertex.receiver = as.integer(c(0, 1, 3, 5, 6, 11)), and specifying this in the code for netVisual_aggregate as well like this: netVisual_aggregate(cell, signaling = pathways.show, vertex.receiver = c(0, 1, 3, 6, 11), vertex.size = groupSize)
However, I always get this error:
Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent
The only way I do not get this error is if I follow the vignette exactly and say vertex.receiver = seq(1, 9).
How do I fix this? Thank you!
it's a wonderful R toolkit, but I had got this error when using the function netClustering
cellchat <- netClustering(cellchat, type = "functional")
Error in as.vector(data): no method for coercing this S4 class to a vector.
Hi,
Thanks for your answer to my previous question. As I was running CellChat, I became aware of a problem. Can I know if the type of interactions in my single-cell data is autocrine or paracrine? How can I tell them apart?
I sincerely hope to get your reply.
error: Failed to install 'CellChat' from GitHub:
installation of package ‘backports’ had non-zero exit status. R-3.6.3 or R4.0 64-bit.
Hi @sqjin! Hope you're doing good. I'm having an issue and I was hoping you can help me
While running
cellchat <- identifyOverExpressedGenes(cellchat)
I get this error!
| | 0 % ~calculating Error in data1[x, ] : subscript out of bounds
Do you know what could it be?
Here is the complete code
DefaultAssay(seuratObj) <- 'integrated'
Idents(seuratObj) <- seuratObj$group
seuratObj$group=factor(seuratObj$group)
data.input <- seuratObj@assays$integrated@data # normalized data matrix
groups <- levels(seuratObj$group)
group <- groups[1]
subcells <- WhichCells(object = seuratObj, idents = group)
data.sub <- data.input[,subcells]
labels <- seuratObj$finalCluster[subcells]
identity <- data.frame(group = labels, row.names = names(labels)) # create a dataframe of the cell labels
cellchat <- createCellChat(data = data.sub)
cellchat <- addMeta(cellchat, meta = identity, meta.name = "labels")
cellchat <- setIdent(cellchat, ident.use = "labels") # set "labels" as default cell identity
levels(cellchat@idents) # show factor levels of the cell labels
#####################################################################################################
#####################################################################################################
CellChatDB <- CellChatDB.mouse # use CellChatDB.mouse if running on mouse data
showDatabaseCategory(CellChatDB)
# Show the structure of the database
dplyr::glimpse(CellChatDB$interaction)#选取列操作
CellChatDB.use <- subsetDB(CellChatDB, search = "Secreted Signaling") # use Secreted Signaling for cell-cell communication analysis
cellchat@DB <- CellChatDB.use # set the used database in the object# ####################
cellchat <- subsetData(cellchat) # subset the expression data of signaling genes for saving computation cost
#####################################保存cellchatDatabase######################
###CellChatDBfuture::plan("multiprocess", workers = 6) # do parallel
cellchat <- identifyOverExpressedGenes(cellchat)#不行
cellchat <- identifyOverExpressedInteractions(cellchat)#可以
cellchat <- projectData(cellchat, PPI.mouse)
cellchat <- computeCommunProb(cellchat)
cellchat <- computeCommunProbPathway(cellchat)
cellchat <- aggregateNet(cellchat)
Hi,
I'm sorry to bother you again. When I use CellChat to infer structural similarity, an error is generated.
The code is : cellchat <- netEmbedding(cellchat, type = "structural")
The error is : Error in py_call_impl(callable, dots$args, dots$keywords) :
SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no longer supported!
I looked up the cause of this problem, which may be related to the python's version. Could you fixed it?
In additon, my python version is 3.6.
I'm looking forward to your reply.
Dear author,
May I realize how to output exact ligand-receptor list of specific data of pathway? For example, wnt signaling pathway including different ligands participating in signaling transduction, ctgf, dkk2, igfbp4, etc, and receptor of wnt signalling pathway including fzd2, fzd7, lgr5 and lrp6.
Thanks for kind attention.
dentistZ
Hello, team CellChat.
I use pbmc3k data from SeuratData to study your tutorial.
This was going well, but there was an error when I ran this function,
netVisual_aggregate(cellchat, signaling = pathways.show, vertex.receiver = vertex.receiver, vertex.size = groupSize)
Error in text.default(x, y, labels = labels, col = label.color, family = label.family, :
invalid font type
This looks like a little bit of a conflict with the igraph
I don't know how to solve it, so I come to ask for help.
Thank you for your excellent R package~
Hi,
Thanks for the great tool. I notice that for some of the signaling pathways, the hierarchical plot is inconsistent with the circle plot or the network centrality heatmap.
Below is one of the example, both circle plot and network centrality heatmap show strong cell communication between cell type "Epithelial_M" and "Epithelial_P", but the hierarchical plot (the first plot) does not show such cell communication. What could be the reason? Thanks!
Hello, I tried to install this package with R stdio on windows7, but failed with the following message:
c:\rtools40\mingw64\bin\nm.exe: CellChat_Rcpp.o: file format not recognized
......
I notice that the files under src folder are *.o and *.so, which are not windows file type. The right windows file type should be *.obj and *.dll.
Is there something wrong with my operation or this package can not install on windows?
hi~sorry to bother,perfect R toolkit,but I get trouble when I want to use the function identifyCommunicationPatterns(cellchat, pattern = "incoming", k = nPatterns), are there some solution?
How to change a cell identity label without re-analysing the whole dataset?
I did
cellchat <- setIdent(cellchat, ident.use = "cell_type") # set "cell_type" as default cell identity (the new ones)
levels(cellchat@idents)
groupSize <- as.numeric(table(cellchat@idents))
it shows the right new idents, but the plots still show the initial cell annotation.
Thanks!
Hi,
I'm really sorry to bother you again. When I mapped the total cell interaction network(Circleplot), the effect of presentation were poor because there were too many cell types. So, I was wondering if I could draw a simple version of the interactive loop diagram based on the cell type I specified.( Let's say I have a total of 12 cell types, and I'm only looking at four of those cell types. Meanwhile, the type of drawing is a circleplot )
In additon, Can I consider showing L-R numbers according to my will( The example is shown in the figure below)? L-R number representation is determined by a TRUE or FALSE according code setting.
I do not know how you drew the figure 4d in your paper. Because I did not find any tutorials in your github about it.
CellChat is a very good R package but it is a little difficult for me to understand the structure of the cellchat object.
For example, when I look at Tgfb1-(Tgfbr1 + Tgfbr2), I do not know which group of cells are receivers and which group of cells are senders.
Could you please give me some clarification about them at your earliest convenience?
Hi Jin,
Thank you for this resource.
I have a question about the data normalization. Is it possible to proceed with TPM instead of using the normalization method you used in the paper?
Thank you!
Warmest regards,
Nicholas Ho
Hello, when I install the CellChat R packages, something wrong with the CellChat.so file. The error messages are as follows:
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘CellChat’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/czc/anaconda3/envs/scvi/lib/R/library/00LOCK-CellChat-master/00new/CellChat/libs/CellChat.so':
/home/czc/anaconda3/envs/scvi/lib/R/library/00LOCK-CellChat-master/00new/CellChat/libs/CellChat.so: invalid ELF header
Error: loading failed
Execution halted
ERROR: loading failed
It seems that there was a problem with the CellChat.so file, which make me unable to install.
And I can't open this file, with the same ERROR messages: invalid ELF header
(scvi) [czc@covid libs]$ readelf -d CellChat.so
readelf: CellChat.so: Error: Not an ELF file - it has the wrong magic bytes at the start
Additional, It's difficult for me to install this packages from github by devtools, so I download and install this package from local.
Looking forward to your reply!Thank you very much!
Hi,
Is there a way to customise the database? I'm using the mouse database and looking specifically for KEGG: mmu04620. However, I didn't find this in it. So I wonder if it is possible to add this one? And if yes, could you please provide how to do it? Thanks!
Hi @sqjin! Hope you're doing good. I'm having an issue and I was hoping you can help me
While running
cellchat <- computeCommunProbPathway(cellchat)
I get this error!
Error in prob.pathways[, , pathways.sig]: subscript out of bounds
Traceback:
1. computeCommunProbPathway(cellchat)
Do you know what could it be?
Here is the complete code
data.input <- GetAssayData(LAPV.integrated, assay = "integrated", slot = "data") # normalized data matrix
Idents(object = LAPV.integrated) <- 'Named'
labels <- Idents(LAPV.integrated)
identity <- data.frame(group = labels, row.names = names(labels)) # create a dataframe of the cell labels
cellchat <- createCellChat(data = data.input)
cellchat <- addMeta(cellchat, meta = identity, meta.name = "labels")
cellchat <- setIdent(cellchat, ident.use = "labels") # set "labels" as default cell identity
CellChatDB <- CellChatDB.mouse # use CellChatDB.human if running on human data
CellChatDB.use <- subsetDB(CellChatDB, search = "Secreted Signaling")
cellchat@DB <- CellChatDB.use # set the used database in the object
cellchat <- subsetData(cellchat) # subset the expression data of signaling genes for saving computation cost
future::plan("multiprocess", workers = 8) # do parallel
cellchat <- identifyOverExpressedGenes(cellchat)
cellchat <- identifyOverExpressedInteractions(cellchat)
cellchat <- projectData(cellchat, PPI.mouse)
groupSize <- as.numeric(table(cellchat@idents))
cellchat <- computeCommunProb(cellchat)
cellchat <- computeCommunProbPathway(cellchat)
Hi @sqjin, I just wonder how to use the "ECM-Receptor" and "Cell-Cell Contact" annotation in the package? Could you give a quick example of these two part?
Thanks!
Hi,
Thanks for developing CellChat, which is very user-friendly and convenient. But I don't know what to do when I want to draw a circleplot of all the functional pathways.
The code is netVisual_aggregate(cellchat, signaling = pathways.show, layout = "circle", vertex.size = groupSize). So, Should I enter all the pathways manually? After I manually enter all the pathways, the title of circleplot got farraginous.
I sincerely hope to get your reply.
Good tools to analyze cell-cell communication, and i have an error when i did
cellchat <- netClustering(cellchat, type = "structural"), and the error was that Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), : 'data'的种类必需为矢量,但现在是'NULL', but i have got all the results before, and i don't know what went wrong. Can you help me ?Thank you very much.Best wishes.
Hi,
CellChat is a very powerful tool to analyse cell interactions. In CellChat tutorial, we focus on functional pathway. But when I look at it from a macro perspective, can I do an interaction analysis from a cell type perspective alone?
For instanse, just like the picture below.
If I just want to focus on one cell type interacts with all the other cells, can I just keep lines for that type of interaction with another cells and remove lines for other types of interaction. Because sometimes you need to emphasize the importance of certain cells for interaction.
In addition, Can the size of the circle in the circleplot be shown by the number of L-R cells divided by the number of cells(groupSize)? The purpose of doing this is to balance the bias caused by the number of cells. Because some cells may have high interactions due to large cardinality.
I sincerely look forward to receiving your reply
Hello, when I used the function computeCommunProb(), it always reported an error: there is no package called ‘CellChat’. Could you give me some advice to solve the problem? Thank you! @sqjin
Hi,
CellChat does pioneering work comparing multiple databases about cell-cell communication. But I still have confused about the results of comparing multiple data sets. Just like the picture below:
Larger distance implies larger difference of the communication networks between Database1 and Database2. So for this graph, can you explain whether database 1 is more enriched or database 2 is more enriched on some signaling pathways(eg WNT). In other words, Could it be said that dataset 1 enriched more on the WNT pathway and dataset 2 enriched less.
Another problem is that when I compare multiple datasets(>2), rankSimilarity and rankNet cannot show the differences from multiple datasets.
Looking forward to your kind reply.
Hi,
A quick question on subsetData function. Does this function filters all ligands and receptors from the user input gene matrix?If so which columns in the database files (geneInfo/complex/Interaction) are used for matching this?
I want to use interactions associated with all 3 annotations (1.Secreted Signaling, 2.Cell-Cell Contact, 3.ECM-Receptor) and does not want to filter interactions associated only with "secreted signaling".
My questions are
Could you please advise?
Thank you,
Janaki
Hi, when running, cellchat <- netEmbedding(cellchat, type = "functional", k=5)
, I encountered the Error==>Error in py_call_impl(callable, dots$args, dots$keywords) : TypeError: 'float' object cannot be interpreted as an index.
Traceback Info:
SessionInfo:
R version 3.6.1 (2019-07-05)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] CellChat_0.0.1 bigmemory_4.5.36 Biobase_2.46.0 BiocGenerics_0.32.0
loaded via a namespace (and not attached):
[1] tidyr_1.0.2 jsonlite_1.6.1 foreach_1.4.8 network_1.16.0
[5] assertthat_0.2.1 ggrepel_0.8.1 gdtools_0.2.2 globals_0.12.5
[9] pillar_1.4.3 lattice_0.20-40 glue_1.3.1 reticulate_1.14
[13] digest_0.6.25 RColorBrewer_1.1-2 colorspace_1.4-1 cowplot_1.0.0
[17] Matrix_1.2-18 plyr_1.8.6 pkgconfig_2.0.3 bibtex_0.4.2.2
[21] GetoptLong_0.1.8 listenv_0.8.0 purrr_0.3.3 xtable_1.8-4
[25] scales_1.1.0 svglite_1.2.3.2 sna_2.5 ggalluvial_0.12.1
[29] RSpectra_0.16-0 tibble_2.1.3 pkgmaker_0.31 farver_2.0.3
[33] ggplot2_3.2.1 ellipsis_0.3.0 withr_2.1.2 pbapply_1.4-2
[37] lazyeval_0.2.2 magrittr_1.5 crayon_1.3.4 statnet.common_4.3.0
[41] future_1.16.0 doParallel_1.0.15 NMF_0.22.0 FNN_1.1.3
[45] tools_3.6.1 registry_0.5-1 GlobalOptions_0.1.1 lifecycle_0.1.0
[49] gridBase_0.4-7 ComplexHeatmap_2.2.0 stringr_1.4.0 munsell_0.5.0
[53] cluster_2.1.0 rngtools_1.5 irlba_2.3.3 compiler_3.6.1
[57] systemfonts_0.2.3 rlang_0.4.5 grid_3.6.1 iterators_1.0.12
[61] rstudioapi_0.11 rappdirs_0.3.1 rjson_0.2.20 bigmemory.sri_0.1.3
[65] circlize_0.4.8 igraph_1.2.4.2 labeling_0.3 gtable_0.3.0
[69] codetools_0.2-16 reshape2_1.4.3 R6_2.4.1 dplyr_0.8.4
[73] future.apply_1.4.0 clue_0.3-57 shape_1.4.4 stringi_1.4.6
[77] Rcpp_1.0.3 vctrs_0.2.3 png_0.1-7 tidyselect_1.0.0
[81] coda_0.19-3
How can I fix it ?
Hi Suoqin,
Thanks for this really nice tool. I was wondering if you can give some advice on if it is possible to use CellChat for custom interactions specified by the user.
Thank you,
Janaki
as the title, thanks
Hi,
Thanks for developing this user-friendly tool. I have a problem about mapping total cellular interaction network. (This is a representation of the entire data set rather than a single pathway)Just like the following picture shown:(url
)
Different circles represent different cell types. The size of the cell circle represents more cellular interaction.(It means that certain cells are involved in more cellular communication ) The thickness of the lines is positively correlated with the number of ligand-receptor interaction events.
I sincerely hope to get your kind reply.
ps:感谢您今天在哔哩哔哩直播中的分享,因为实验错过了前面部分,很遗憾。希望金老师以后还能继续开课。期待!
Hello,
Thank you for developing this wonderful tool~
I have a question :
when I got the hierarchical plot to work, I got this error:
Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent
Could you give me some suggestions to fix it?
the code I used
data.input = as.matrix(sce@assays$RNA@counts)
data.input <- normalizeData(data.input, scale.factor = 10000, do.log = TRUE)
identity = data.frame(group = sce$integrated_snn_res.1, row.names = names(sce$integrated_snn_res.1))
# the sce is a Seurat object. The data in the integrated only 2000 genes, so I used the counts in RNA with all genes.
cellchat <- createCellChat(data = data.input)
cellchat <- addMeta(cellchat, meta = identity, meta.name = "labels")
cellchat <- setIdent(cellchat, ident.use = "labels")
levels(cellchat@idents)
groupSize <- as.numeric(table(cellchat@idents))
CellChatDB <- CellChatDB.mouse # use CellChatDB.human if running on human data
CellChatDB.use <- subsetDB(CellChatDB, search = "Secreted Signaling")
cellchat@DB <- CellChatDB.use
cellchat <- subsetData(cellchat)
future::plan("multiprocess", workers = 2)
cellchat <- identifyOverExpressedGenes(cellchat)
cellchat <- identifyOverExpressedInteractions(cellchat)
cellchat <- projectData(cellchat, PPI.mouse)
cellchat <- computeCommunProb(cellchat)
cellchat <- computeCommunProbPathway(cellchat)
cellchat <- aggregateNet(cellchat)
cellchat@netP$pathways
# "NRG" "FGF" "CSF" "MK" "PTN" "KIT" "NT" "SEMA3" "GAS" "PSAP"
pathways.show <- c("NRG")
levels(cellchat@idents)
vertex.receiver = seq(0,7)
# I change the vertex.receiver to equal seq(1,8) and I got the same error
groupSize <- as.numeric(table(cellchat@idents))
# Hierarchy plot
netVisual_aggregate(cellchat, signaling = pathways.show, # layout = "hierarchy",
vertex.receiver = vertex.receiver,
vertex.size = groupSize)
# run this code return the error:
Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent
and the R session :
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] zh_CN.UTF-8/zh_CN.UTF-8/zh_CN.UTF-8/C/zh_CN.UTF-8/zh_CN.UTF-8
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] igraph_1.2.5 mindr_1.2.3 Seurat_3.2.0 ggalluvial_0.12.1
[5] ggplot2_3.3.2 CellChat_0.0.1 Biobase_2.48.0 BiocGenerics_0.34.0
loaded via a namespace (and not attached):
[1] backports_1.1.8 circlize_0.4.10 systemfonts_0.2.3
[4] NMF_0.23.0 plyr_1.8.6 lazyeval_0.2.2
[7] splines_4.0.2 listenv_0.8.0 usethis_1.6.1
[10] gridBase_0.4-7 digest_0.6.25 foreach_1.5.0
[13] htmltools_0.5.0 fansi_0.4.1 magrittr_1.5
[16] memoise_1.1.0 tensor_1.5 cluster_2.1.0
[19] doParallel_1.0.15 ROCR_1.0-11 remotes_2.2.0
[22] sna_2.5 ComplexHeatmap_2.4.3 globals_0.12.5
[25] svglite_1.2.3.2 prettyunits_1.1.1 colorspace_1.4-1
[28] ggrepel_0.8.2 dplyr_1.0.2 callr_3.4.3
Thank you very much!
Hi,
Thanks for developing this user-friendly tool.
I have problem that I can't go through when running:
cellchat <- identifyCommunicationPatterns(cellchat, pattern = "outgoing", k = nPatterns)
Error in (new("standardGeneric", .Data = function (x) :
unused arguments (model = list("NMFstd", 3, 0), method = "nndsvd")
Called from: do.call(getGeneric("seed"), c(list(x = x, model = init, method = seed.method),
parameters.seed))
Can you kindly help me with this problem? thank you very much!
Hi,
Thanks for developing this user-friendly tool. When I was studying the literature you published on bioRxiv, I was very interested in one of the illustrations. As shown in the figure below. Can you provide an example of drawing this diagram with the CellChat object. (It means the function and code that implements the diagram)
CellChat/R/modeling.R file 372 line
computeExpr_antagonist function
data.antagonist = matrix(1, nrow = 1, ncol = length(group))
should be ?
data.antagonist = matrix(1, nrow = 1, ncol = length(unique(group)))
When I use Seurat
packages data pbmc3k.final
to run CellChat
in linux . The process of debug as follow:
https://www.jianshu.com/p/da145cff3d41
Thanks for your great jobs.
Hello,
I have three questions;
Thank you very much
Hi there, thanks for making this great tool. It's quite easy to use and I can see it getting adopted widely in the field.
I have managed to run my individual seurat objects without any issues.
When I switched to comparing 2 datasets, WT vs mutant, I managed to create individual cellchat objects and merged them together. However, I ran into an error at the next computeNetSimilarity step (following this https://htmlpreview.github.io/?https://github.com/sqjin/CellChat/blob/master/vignettes/Joint_analysis_of_multiple_datasets.html).
WT <- readRDS("WT.rds")
DefaultAssay(WT)<-"RNA"
WT<-NormalizeData(WT)
WT<-ScaleData(WT)
data.input <- GetAssayData(WT, assay = "RNA", slot = "data") # normalized data matrix
labels <- Idents(WT)
identity <- data.frame(group = labels, row.names = names(labels))
unique(identity$group)
WT <- createCellChat(data = data.input)
WT <- addMeta(WT, meta = identity, meta.name = "labels")
WT <- setIdent(WT, ident.use = "labels") # set "labels" as default cell identity
levels(WT@idents) # show factor levels of the cell labels
groupSize <- as.numeric(table(WT@idents))
mutant <- readRDS("mutant.rds")
DefaultAssay(mutant)<-"RNA"
mutant<-NormalizeData(mutant)
mutant<-ScaleData(mutant)
data.input <- GetAssayData(mutant, assay = "RNA", slot = "data") # normalized data matrix
labels <- Idents(mutant)
identity <- data.frame(group = labels, row.names = names(labels))
unique(identity$group)
mutant <- createCellChat(data = data.input)
mutant <- addMeta(mutant, meta = identity, meta.name = "labels")
mutant <- setIdent(mutant, ident.use = "labels") # set "labels" as default cell identity
levels(mutant@idents) # show factor levels of the cell labels
cellchat <- mergeCellChat(list(WT, mutant), add.names = c("WT","mutant"))
cellchat <- computeNetSimilarityPairwise(cellchat, type = "structural")
Error in net[[i]] : subscript out of bounds
Please advise.
Thanks,
Lipin
Hi,
Thanks for developing this user-friendly tool.
I have one problem that I can't go through when running:
netVisual_aggregate(cellchat, signaling = pathways.show, layout = "circle", vertex.size =groupSize)
Error in text.default(x, y, labels = labels, col = label.color, family = label.family, :
字体类别出错
Can you kindly help me with this problem? thank you very much!
Hi, This tool seems funny. But I got an error when saving the graph to PDF.
Codes:
pdf('./test.pdf') # ------line1
netVisual_aggregate(cellchat, signaling = pathways.show,vertex.receiver = vertex.receiver, vertex.size = groupSize) # ------line2
dev.off() # ------line3
Magically, it worked if I ran the line2 only.
ERROR:
Error in text.default(x, y, labels = labels, col = label.color, family = label.family, : invalid font type
Traceback:
1. netVisual_aggregate(cellchat, signaling = pathways.show, vertex.receiver = vertex.receiver,
. vertex.size = groupSize)
2. netVisual_hierarchy1(prob.sum, vertex.receiver = vertex.receiver,
. color.use = color.use, vertex.size = vertex.size, signaling.name = NULL,
. vertex.label.cex = vertex.label.cex)
3. plot(g, edge.curved = edge.curved, layout = coords_scale, margin = margin,
. rescale = T, vertex.shape = "fcircle", vertex.frame.width = c(rep(1,
. m1), rep(2, nrow(net3) - m1)), vertex.label.degree = label.locs,
. vertex.label.dist = label.dist, vertex.label.family = "Arial")
4. plot.igraph(g, edge.curved = edge.curved, layout = coords_scale,
. margin = margin, rescale = T, vertex.shape = "fcircle", vertex.frame.width = c(rep(1,
. m1), rep(2, nrow(net3) - m1)), vertex.label.degree = label.locs,
. vertex.label.dist = label.dist, vertex.label.family = "Arial")
5. text(x, y, labels = labels, col = label.color, family = label.family,
. font = label.font, cex = label.cex)
6. text.default(x, y, labels = labels, col = label.color, family = label.family,
. font = label.font, cex = label.cex)
SessionInfo:
R version 3.6.1 (2019-07-05)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /home/liunianping/miniconda3/envs/GALAXY/lib/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8
[9] LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] systemfonts_0.2.3 Seurat_3.1.5 svglite_1.2.3.2
[4] ggalluvial_0.12.1 ggplot2_3.3.1 CellChat_0.0.1
[7] Biobase_2.46.0 BiocGenerics_0.32.0
loaded via a namespace (and not attached):
[1] Rtsne_0.15 colorspace_1.4-1 rjson_0.2.20
[4] ellipsis_0.3.1 ggridges_0.5.2 circlize_0.4.10
[7] IRdisplay_0.7.0 GlobalOptions_0.1.2 base64enc_0.1-3
[10] clue_0.3-57 farver_2.0.3 leiden_0.3.3
[13] listenv_0.8.0 ggrepel_0.8.2 RSpectra_0.16-0
[16] codetools_0.2-16 splines_3.6.1 doParallel_1.0.15
[19] IRkernel_1.1.1.9000 jsonlite_1.6.1 gridBase_0.4-7
[22] ica_1.0-2 cluster_2.0.8 png_0.1-7
[25] uwot_0.1.8 sctransform_0.2.1 compiler_3.6.1
[28] httr_1.4.1 lazyeval_0.2.2 assertthat_0.2.1
[31] Matrix_1.2-17 htmltools_0.4.0 tools_3.6.1
[34] rsvd_1.0.3 igraph_1.2.5 coda_0.19-3
[37] gtable_0.3.0 glue_1.4.1 RANN_2.6.1
[40] reshape2_1.4.4 dplyr_1.0.0 rappdirs_0.3.1
[43] Rcpp_1.0.4.6 statnet.common_4.3.0 NMF_0.23.0
[46] vctrs_0.3.0 ape_5.4 nlme_3.1-139
[49] iterators_1.0.12 lmtest_0.9-37 stringr_1.4.0
[52] globals_0.12.5 network_1.16.0 lifecycle_0.2.0
[55] irlba_2.3.3 rngtools_1.5 future_1.17.0
[58] MASS_7.3-51.3 zoo_1.8-8 scales_1.1.1
[61] RColorBrewer_1.1-2 ComplexHeatmap_2.2.0 gridExtra_2.3
[64] reticulate_1.16 pbapply_1.4-2 pkgmaker_0.31.1
[67] gdtools_0.2.2 stringi_1.4.6 foreach_1.5.0
[70] bibtex_0.4.2.2 shape_1.4.4 repr_1.1.0
[73] rlang_0.4.6 pkgconfig_2.0.3 evaluate_0.14
[76] lattice_0.20-38 ROCR_1.0-11 purrr_0.3.4
[79] labeling_0.3 htmlwidgets_1.5.1 patchwork_1.0.0
[82] cowplot_1.0.0 tidyselect_1.1.0 RcppAnnoy_0.0.16
[85] plyr_1.8.6 magrittr_1.5 R6_2.4.1
[88] generics_0.0.2 sna_2.5 pbdZMQ_0.3-3
[91] pillar_1.4.4 withr_2.2.0 fitdistrplus_1.1-1
[94] survival_2.44-1.1 tsne_0.1-3 tibble_3.0.1
[97] future.apply_1.5.0 crayon_1.3.4 uuid_0.1-4
[100] KernSmooth_2.23-15 plotly_4.9.2.1 GetoptLong_1.0.2
[103] grid_3.6.1 data.table_1.12.8 FNN_1.1.3
[106] digest_0.6.25 xtable_1.8-4 tidyr_1.1.0
[109] munsell_0.5.0 viridisLite_0.3.0 registry_0.5-1
Other Info:
I ran this on linux platform actually, all is ok till now, except saving the graphs to PDF. It seems need the font Arial, But as I know, I have installed the Arial font, as below:
[***@bio fonts]$ pwd
/usr/share/fonts
[***@bio fonts]$ ll -rt
total 16
drwxr-xr-x. 4 root root 48 Jul 12 2016 default
drwxr-xr-x. 2 root root 4096 Jul 12 2016 stix
drwxr-xr-x. 2 root root 4096 Aug 2 2016 dejavu
drwxr-xr-x 2 root root 44 Oct 3 2016 sil-abyssinica
drwxr-xr-x 2 root root 131 Feb 12 2019 abattis-cantarell
drwxr-xr-x 2 root root 43 Feb 12 2019 google-noto-emoji
drwxr-xr-x. 2 root root 4096 Feb 12 2019 liberation
drwxr-xr-x 2 root root 4096 Aug 18 22:01 msttcore
[***@bio fonts]$ ll msttcore/
total 5688
-rw-r--r-- 1 root root 105468 Nov 25 2008 andalemo.ttf
-rw-r--r-- 1 root root 286620 Nov 25 2008 arialbd.ttf
-rw-r--r-- 1 root root 224692 Nov 25 2008 arialbi.ttf
-rw-r--r-- 1 root root 206132 Nov 25 2008 ariali.ttf
-rw-r--r-- 1 root root 275572 Nov 25 2008 arial.ttf
-rw-r--r-- 1 root root 117028 Nov 25 2008 ariblk.ttf
-rw-r--r-- 1 root root 111476 Nov 25 2008 comicbd.ttf
-rw-r--r-- 1 root root 126364 Nov 25 2008 comic.ttf
-rw-r--r-- 1 root root 311508 Nov 25 2008 courbd.ttf
-rw-r--r-- 1 root root 234788 Nov 25 2008 courbi.ttf
-rw-r--r-- 1 root root 244156 Nov 25 2008 couri.ttf
-rw-r--r-- 1 root root 302688 Nov 25 2008 cour.ttf
-rw-r--r-- 1 root root 139584 Nov 25 2008 georgiab.ttf
-rw-r--r-- 1 root root 156668 Nov 25 2008 georgiai.ttf
-rw-r--r-- 1 root root 142964 Nov 25 2008 georgia.ttf
-rw-r--r-- 1 root root 158796 Nov 25 2008 georgiaz.ttf
-rw-r--r-- 1 root root 136076 Nov 25 2008 impact.ttf
-r--r--r-- 1 root root 105312 Nov 25 2008 tahoma.ttf
-rw-r--r-- 1 root root 333900 Nov 25 2008 timesbd.ttf
-rw-r--r-- 1 root root 238612 Nov 25 2008 timesbi.ttf
-rw-r--r-- 1 root root 247092 Nov 25 2008 timesi.ttf
-rw-r--r-- 1 root root 330412 Nov 25 2008 times.ttf
-rw-r--r-- 1 root root 123828 Nov 25 2008 trebucbd.ttf
-rw-r--r-- 1 root root 131188 Nov 25 2008 trebucbi.ttf
-rw-r--r-- 1 root root 139288 Nov 25 2008 trebucit.ttf
-rw-r--r-- 1 root root 126796 Nov 25 2008 trebuc.ttf
-rw-r--r-- 1 root root 136032 Nov 25 2008 verdanab.ttf
-rw-r--r-- 1 root root 154264 Nov 25 2008 verdanai.ttf
-rw-r--r-- 1 root root 139640 Nov 25 2008 verdana.ttf
-rw-r--r-- 1 root root 153324 Nov 25 2008 verdanaz.ttf
-rw-r--r-- 1 root root 118752 Nov 25 2008 webdings.ttf
I am so confused about this error, maybe, should I give a 'Path-like configuration' to the R? Or, was this error was caused by some other reason?
Hi, thanks for this nice tool, can you give some suggestions about analysis on other species, like Macaque or Rat? I this maybe we need to replace gene names of human by homologous gene names in Macaque, if so which files should be changed?
Brandon
Hi, thanks for developing this user-friendly tool. When I used the netvisual_bubble function to draw the communication pairs, I had some questions about the parameters of this functions. what do the “from” and
"to" mean? Should it be a cell type name?Moreover, how can I set a proper vertex.receiver for hierarchy plot?
(ps:I think the function of vertex.receive is to provide a fancier layout of the hierarchy plot? )
Thanks for developing this powerful tool! I am testing with our own scRNAseq data. Everything works good by following the walkthrough vignette, until the 'identifyCommunicationPatterns' function:
nPatterns = 5
cellchat <- identifyCommunicationPatterns(cellchat, pattern = "outgoing", k = nPatterns)
Error in (new("standardGeneric", .Data = function (x) :
unused arguments (model = list("NMFstd", 5, 0), method = "nndsvd")
It looks like an error related to the calling of nmf function. Could you help debug this? Thanks!
Yu
Found the solution under NMF installing section. Issue solved. Please close this. Thanks.
Hi,
I have created two objects (ctrl and dis) following the instructions, then I was trying to merge those two using
cellchat <- mergeCellChat(list(cellchat.ctrl, cellchat.dis), add.names = c("ctrl","dis"))
,
but it looks like the combined dataset has no information in it.
Here's a screenshot:
Please kindly advice. Thanks!
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!
Hello, Mr. Jin,
I used seurat (cca) to integrate the data, and the input matrix is as follows:
However, when I run "computeCommunProb()", there are some warnings.
next, when I run "computeCommunProbPathway()", errored.
I want to know if this error is related to negative values in the matrix?
In addition, can Cellchat run the integrated data, and if so, what should be done?
Hope to get your help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.