zktuong / ktplots

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

Error: Please check your options for split.by and your celltypes. #48

Closed TehseusKunka closed 1 year ago

TehseusKunka commented 2 years ago

When using "plot_cpdb"function, I have checked the colnames of cell type and the names of each cells, it still comes error with " Please check your options for split.by and your celltypes."

image image

How can I deal with this problems, thank you.

zktuong commented 2 years ago

hi @TehseusKunka,

In your input to cellphonedb's meta.txt, your second column must look like this: {pN}_{cellTypeLabel}

so that the output columns will be populated that way as well.

if the column names in your cellphonedb output is just cellTypeLabel|cellTypeLabel, then then split.by option will not work and should not be specified.

This can be seen if you take a look at the example means and means2 that comes with ktplots:

> data(cpdb_output)
> data(cpdb_output2)
> head(colnames(means), 15)
 [1] "id_cp_interaction"                   "interacting_pair"                    "partner_a"                          
 [4] "partner_b"                           "gene_a"                              "gene_b"                             
 [7] "secreted"                            "receptor_a"                          "receptor_b"                         
[10] "annotation_strategy"                 "is_integrin"                         "PapRCC_MNPb(mono)|PapRCC_MNPb(mono)"
[13] "PapRCC_MNPb(mono)|PapRCC_NK cell"    "PapRCC_MNPb(mono)|RCC1_CD4T cell"    "PapRCC_MNPb(mono)|RCC1_CD8T cell"   
> head(colnames(means2), 15)
 [1] "id_cp_interaction"   "interacting_pair"    "partner_a"           "partner_b"           "gene_a"             
 [6] "gene_b"              "secreted"            "receptor_a"          "receptor_b"          "annotation_strategy"
[11] "is_integrin"         "B cell|B cell"       "B cell|CD4T cell"    "B cell|CD8T cell"    "B cell|MNPa(mono)" 

So means will work with the split.by option whereas means2 will not

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Pedramto89 commented 1 year ago

When I get a head from means, this is the result:

`head(colnames(means))

[1] "id_cp_interaction" "interacting_pair" "partner_a" "partner_b"
[5] "gene_a" "gene_b"`