zktuong / ktplots

Some tools for plotting single-cell data
https://zktuong.github.io/ktplots/
MIT License
164 stars 32 forks source link

Error in c_type1[[i]] : subscript out of boundstill getting an error. #83

Closed beetlejuice007 closed 1 year ago

beetlejuice007 commented 1 year ago

Hi I am still getting an error. Are numbers allowed in cell-types ?

plot_cpdb( scdata=x, cell_type1="8", cell_type2=".", # this means all cell-types celltype_key="celltype", idents = "seurat_clusters", means=means3, pvals=pvals3, genes=c("PTPRC", "TNFSF13"), title="interacting interactions!", )

Error in c_type1[[i]] : subscript out of bounds

levels(x@active.ident)

[1] "macrophage_5" "macrophage_4" "macrophage_3" "macrophage_2" "macrophage_1" "macrophage_0" "T_Cells_04_1" [8] "T_Cells_04_0" "T_Cells_03_1" "T_Cells_03_0" "T_Cells_00_2" "T_Cells_00_1" "T_Cells_00_0" "T_Cells_01_4" [15] "T_Cells_01_3" "T_Cells_01_2" "T_Cells_01_1" "T_Cells_01_0" "5" "6" "7"
[22] "8" "9" "10" "11"

I am using seurat object as scdata.

Can anyone please help. Thanks.

Originally posted by @hemantgujar in https://github.com/zktuong/ktplots/issues/14#issuecomment-1737507449

zktuong commented 1 year ago

hi what if you remove genes option? does it work?

beetlejuice007 commented 1 year ago

No. Its still not working.

zktuong commented 1 year ago

can you send me snippet of these files so i can see what's going on?

beetlejuice007 commented 1 year ago

Hi @zktuong

The problem was with my h5ad file. I fixed following this solution. https://github.com/ventolab/CellphoneDB/issues/126#issuecomment-1617588836

Thanks