Closed cirsina closed 1 year ago
Hi.
From the error you show I can't think what the problem is, I have the feeling the issue could be with one of the files you provide. Can run the same method but with the data we provided in the examples notebooks? This way we can discard whether CellPhoneDB is correctly installed in your environment.
Thanks
@ktroule Thank you for your very kind suggestion. I ran cpdb with the example data without error, indicating that there's something wrong with my data. I exported the files from the seurat object 'a', with the following script:
a.markers <- FindAllMarkers(a, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.3) DEGs.cpdb <- a.markers %>% filter(p_val_adj<0.05) DEGs.cpdb <- DEGs.cpdb %>% select(cluster, gene) write.table(DEGs.cpdb, file="degs_for_cpdb.txt", row.names=F, sep = "\t", quote = F) meta <- as.matrix(a$seurat_clusters) write.table(meta, file="meta_for_cpdb.txt", row.names=T, col.names = NA, sep = "\t", quote = F) a.counts <- as.matrix(a@assays$RNA@counts) write.table(a.counts, file="counts_for_cpdb.txt", row.names=T, col.names = NA, sep = "\t", quote = F)
I tried both h5ad and txt format for the counts file. h5ad file was obtained from the seurat object using sceasy.
Is there anything I can do to solve this problem?
Thanks again for your help.
@ktroule Progress reporting
I think I solved the problem :) The Error occurs because I used the cluster number as cell type, but they are numeric rather than character. I changed the cell type names and the codes went through successfully.
i meet the same issue, maybe cellphonedb need to handle the case that when the cell_type is number instead of string that the user haven't annotate yet
Thanks for the suggestion.
I'm new to python and cellphonedb, and I'm trying to analyze my data following the tutorial. I got this error when I start the analysis:
The data looks fine:
I do the analysis in Ubuntu 20.04, with conda and python 3.9.
How to deal with this error?