saeyslab / nichenetr

NicheNet: predict active ligand-target links between interacting cells
469 stars 117 forks source link

Error in calculate_niche_de #208

Closed dbswls0322 closed 1 year ago

dbswls0322 commented 1 year ago

Hi, I'm one of user. First of all, I appreciate to your great research.

I have some error in calculate_niche_de.

Actually, I followed vignette-differential_nichenet.md

And I got those errors in below.

Is it because of setting several sender?

This is my niches niches = list( "Lymphoid_niche" = list( "sender" = c("Hep_high","Hep_low"), "receiver" = c("CD4T cell","CD8T cell","Non-conventional T cell","NK-like cell","B cell","Plasma cell")), "Myeloid_niche" = list( "sender" = c("Hep_high","Hep_low"), "receiver" = c("Monocyte","Macrophage","Dendritic cell","Neutrophil","Erythroid","Mast cell")),
"Endo_Fibr_niche" = list( "sender" = c("Hep_high","Hep_low"), "receiver" = c("Endothelial","Fibroblast")))

Please confirm it.

Thanks.

Error

DE_sender = calculate_niche_de(seurat_obj = gepliv_HCC_nichenet %>% subset(features = lr_network$ligand %>% intersect(rownames(gepliv_HCC_nichenet))), niches = niches, type = "sender", assay_oi = assay_oi) # only ligands important for sender cell types Error in filter(): ℹ In argument: sender == sender_other_niche_oi & sender_other_niche == sender_oi. Caused by error: ! ..1 must be of size 1, not size 0. Run rlang::last_trace() to see where the error occurred.

csangara commented 1 year ago

Hi,

This is not due to setting multiple senders in a niche, but rather from having the same senders across different niches (see #197). In addition, in each niche your receiver should only consist of 1 cell type.