zktuong / ktplots

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

Problem is plotting plot_cpdb4 #107

Closed stalware closed 3 months ago

stalware commented 3 months ago

Hello, I am working on visualizing cellphones results and am interested in generating a figure using plot_cpdb4. However I am getting an issue when I am using my data

I am using the following code plot_cpdb4( interaction = c('VEGFA-KDR','VEGFA-EPHB2','NRP2-VEGFA'), cell_type1 = 'Cluster_12|Cluster_14', cell_type2 = c('Cluster_17|Cluster_5','Cluster_11|Cluster_7'), scdata = sce, celltype_key = 'cell_type', means = means, pvals = pvals, deconvoluted = decon, desiredInteractions = list( c("Cluster_12", "Cluster_17"), c("Cluster_12", "Cluster_5"), c("Cluster_14", "Cluster_7") ), keep_significant_only = TRUE, standard_scale = TRUE, )

I get the following error: Error in c_type1[[i]] : subscript out of bounds Attached below test file for means: Appreciate the help!!

test_means.txt

sce_object
zktuong commented 3 months ago

Hi! Is it celltype or cell_type?

stalware commented 3 months ago

Hi! it is celltype, just copied the wrong example. Also, there is another error that pops up - Error in plot_cpdb(scdata = scdata, cell_type1 = ".", cell_type2 = ".", : No significant hits.

Is this because it the specific interaction pair is not significant? I have tried using other pairs as well.

zktuong commented 3 months ago

Did you run cellphonedb in deg_analysis mode? If so, you would need to add deg_analysis=TRUE for every function.

zktuong commented 3 months ago

But yea - you can also toggle the keep significant only option so then it should try to plot everything

stalware commented 3 months ago

cellphondb was run with statistical_analysis. Also tossing off the keep_significant_only option also does not seem to work.

zktuong commented 3 months ago

Hmm ok. Could you send me your cellphonedb output files and the sce object (without gene expression is fine) so i can do more testing after the holidays? z.tuong@uq.edu.au

zktuong commented 3 months ago

closing this for now as the issue seems to be that the DefaultAssay in the seurat object was integrated instead of RNA, so those genes weren't in the single-cell object