saeyslab / nichenetr

NicheNet: predict active ligand-target links between interacting cells
452 stars 113 forks source link

NicheNet Prioritization with pre-calculated DEGs #218

Closed AClab-sgarcia closed 5 months ago

AClab-sgarcia commented 11 months ago

Hello,

I am currently going through the Perform NicheNet analysis with prioritization vignette.

In my data I perform a pseudobulk approach with DESeq2 to perform the DEGs in each of the clusters between 2 conditions. I would like to know if there is any way in which I could use these results to perform the DE_table needed in process_table_to_ic() function.

Thanks, Saioa

csangara commented 9 months ago

Hi Saioa,

Sorry for the late reply. These are the columns of DE_table:

> colnames(DE_table)
[1] "p_val"      "avg_log2FC" "pct.1"      "pct.2"      "p_val_adj"  "cluster_id" "gene"      

It should work if you rename and add columns to match those of DE_table. So you'll have to rename the "log2FoldChange" "pvalue", and "padj" columns of DESeq2, and add the "gene", "cluster_id", "pct.1" and "pct.2" columns. You can calculate "pct.1" and "pct.2" as the fraction of samples that express that gene in each group, but you can also set it all to some random value since this value won't be used for the prioritization. "cluster_id" represents the cell type, and "gene" is just the gene name.

Hope this helps.