Closed connerlambden closed 1 year ago
Hi @connerlambden, does plot_cpdb
work with keep_significant_only = FALSE
? Also are your files from deg_analysis
mode in CellPhoneDB
? If so, you may need to add the option deg_analysis =TRUE
.
@zktuong thanks for the help! This is not deg_analysis.
For plot_cpdb
, when I set keep_significant_only = TRUE
, I get the following error:
Error in which(unlist(anysig)): argument to 'which' is not logical Traceback:
and when I set keep_significant_only = FALSE
I get the same error as before (“'x' is NULL so the result will be NULL”)
I was able to get plot_cpdb3 to work!
However, plot_cpdb2
is giving the error:
Error in h(simpleError(msg, call)): error in evaluating the argument 'i' in selecting a method for function '[': error in evaluating the argument 'x' in selecting a method for function 'which': subscript contains invalid names Traceback:
Intracellular trafficking
= "#9c755f",
. DC_development = "#B07aa1", Unknown = "#e7e7e7"), node_group_colors = c(seurat_cluster_0 = "red",
. seurat_cluster_1 = "blue"), keep_significant_only = FALSE,
. standard_scale = TRUE, remove_self = TRUE)And plot_cpdb4
gives the following warning message and then returns <NA>
:
Warning message:
“Since you have set group
, you should better set grid.col
as a named
vector where sector names are the vector names (should contain all
sectors).”
Warning message in structure(rand_color(length(unnamed_grid)), names = unnamed_grid):
“restarting interrupted promise evaluation”
Warning message in structure(rand_color(length(unnamed_grid)), names = unnamed_grid):
“internal error -3 in R_decompress1”
Thanks.
So there's a couple of issues here.
1) plot_cpdb
not sure what's going on, but your command is causing the internal functions to not generate a proper dataframe. is genes = genes_to_plot
malformed?
2) plot_cpdb2
is
interaction_grouping = interaction_annotation
and
edge_group_colors = c(Activating = "#e15759", . Chemotaxis = "#59a14f", Inhibitory = "#4e79a7", Intracellular trafficking = "#9c755f", . DC_development = "#B07aa1", Unknown = "#e7e7e7")
directly from the README
? You should create one that is more complete for your dataset as my dataframe is only a subset of interactions.
Had same error with plot_cpdb, plot_cpdb2 etc,
cdb <- plot_cpdb(cell_type1 = celltype1, cell_type2 = celltype2,
scdata = SOT_sc,
idents = 'Fine_Annotation', # column name where the cell ids are located in the metadata
means = means,
pvals = pvals
Error in hclust(d) : NA/NaN/Inf in foreign function call (arg 10)
Apparently if I block the part where hierarchcial clustering is applied on the distance metrix; it works fine. SO i think the cluster_rows = T being default in plot_cpdb, this could carry over to plot_cpdb2 or 3 as well as they use plot_cpdb internally.
# if (nrow(means_mat) > 2) {
# d <- dist(as.data.frame(means_mat))
# h <- hclust(d)
# means_mat <- means_mat[h$order, , drop = FALSE]
# pvals_mat <- pvals_mat[h$order, , drop = FALSE]
I retrieved the distance matrix;
a part of it looks like this ; I guess entire vectors with NA is the issue. Maybe including a filter on NA and warnign on which interaction is NA and hence being removed, could solve the issue
CXCL12-CXCR3
OSMR-OSM
TGFB1-AR
TGFB1-integrin-aVb6-complex
ACKR3-CXCL12
IFNG-Type-II-IFNR
DPP4-CXCL12
TNF-TNFRSF1B
CXCL12-CXCR4
TGFB1-TGFbeta-receptor2
EGFR-TGFB1
TNF-TNFRSF1A
TGFB1-VDR
TGFB1-TGFBR3
TGFB1-TGFbeta-receptor1 0.15030635
TNFRSF1B-GRN 1.76503428 1.36840589
TNFRSF1A-GRN 0.31918960 0.60351636 1.07538970
TNFRSF1A-FASLG NA NA NA NA
TNFSF13-TNFRSF1A NA NA NA NA NA
thanks @saeedfc
I think before adding the filter, i would like to first find out what's causing those NAs - are these with 0 interactions across the cellphonedb output?? By default cellphonedb would remove that prior to generating the output but I suppose it can still happen if you (un)luckily to land on celltypes-celltypes combinations that happened to not express the ligand receptors.
So, if you expand celltype1/2 to have more celltypes, does the error go away?
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.
Hi, when plotting with plot_cpdb3, I'm getting the following error. I've double checked and made sure that my sce (SingleCellExperiment) object has no nans or infs. All colsums/rowsums are > 1.
p <- plot_cpdb3(cell_type1 = 'seurat_cluster_0', cell_type2 = 'seurat_cluster_1', scdata = sce, idents = 'seurat_clusters_names', means = means, pvals = pvals, keep_significant_only = TRUE, standard_scale = TRUE, remove_self = TRUE ) p
Gives the following error:
Error in hclust(d): NA/NaN/Inf in foreign function call (arg 10) Traceback:
Any ideas?
Additionally, when I try to make a dotplot using the following:
plot_cpdb(cell_type1 = "seurat_cluster_0", cell_type2 = "seurat_cluster_1", scdata = sce, idents = 'seurat_clusters_names', means = means, pvals = pvals, genes = genes_to_plot)
I get the following error:
Warning message in rep(yes, length.out = len): “'x' is NULL so the result will be NULL” ERROR while rich displaying an object: Error in ans[ypos] <- rep(yes, length.out = len)[ypos]: replacement has length zero
Thanks for the help!