multinichenetr icon indicating copy to clipboard operation
multinichenetr copied to clipboard

Difference in results between the step by step vignette and multi_nichenet_analysis

Open APuchkina opened this issue 1 year ago • 0 comments

Dear Saeyslab team,

Thanks for the nice package!

I have been running the analysis on multiple datasets using the following vignette: https://github.com/saeyslab/multinichenetr/blob/main/vignettes/condition_specific_celltype_MISC.knit.md

As well as using the function: multi_nichenet_analysis

I keep the following parameters the same for both analyses (the rest are set to default):

  • sce object
  • sample_id
  • group_id
  • celltype_id
  • batches = NA
  • covariates= NA
  • contrasts_oi
  • contrast_tbl
  • senders_oi
  • receivers_oi
  • min_cells
  • logFC_threshold
  • p_val_threshold
  • p_val_adj
  • empirical_pval

My receivers_oi consists of one celltype only. At first I noticed that the multi_nichenet_analysis ignores the definition of receivers_oi and uses all celltypes as receivers_oi. I manually corrected this in the function and that solved the problem for most datasets, but not all. Here is an example of the persisting difference: image image

Here is the code I used to generate both figures: prio_tbl<- multinichenet_output$prioritization_tables group_oi = "XY"

prioritized_tbl_oi_all = get_top_n_lr_pairs( prio_tbl, top_n = 40, rank_per_group = FALSE, groups_oi = group_oi )

#Bubble plots prioritized_tbl_oi_group = prioritized_tbl_oi_all %>% filter(group == group_oi) plot_oi = make_sample_lr_prod_activity_plots_Omnipath( multinichenet_output$prioritization_tables, prioritized_tbl_oi_group %>% inner_join(lr_network_all) )

The difference seems to be in the prioritization itself. One thought I had is that it might be because the step by step vignette filters the sce object after running the frq_list for genes_oi, while the function runs DE_info on the unfiltered sce. I have not tested this out yet but I was wondering what your thoughts are on the issue?

Thank you in advance! Arina

APuchkina avatar Aug 16 '24 10:08 APuchkina