saeyslab / nichenetr

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

Condition_colname is not used for subsetting in nichenet_seuratobj_aggregate #271

Open singlecellfan opened 1 month ago

singlecellfan commented 1 month ago

Hi,

first of all thank you for the great package and the really good documentation!

I am running unfortunately into a very similar problem as described here: https://github.com/saeyslab/nichenetr/issues/220

I am running the "nichenet_seuratobj_aggregate" function and have specified the "condition_colname" as well as the "condition_oi" and the "condition_reference". However when I later check the DE results, it became obvious that the DE genes/ligands were not actually coming from the "condition_oi".

I have version 2.1.0 of nichenetr installed.

Have you encountered this error before? Any way to fix this? Thank you much in advance!

csangara commented 1 month ago

Thanks for using our package!

I'd first like to ask some clarifications on your issue, as the function you are running comes before the one referenced in issue #220.

Let us refer to the output from nichenet_seuratobj_aggregate() as nichenet_output. Do you mean that the DE genes you retrieved from nichenet_output$geneset_oi and the top ligands from nichenet_output$top_ligands are not specific to "condition_oi"?

If that is the case, then it's not an error, but the way the package was designed. For the gene set of interest (geneset_oi), all DE genes between the two conditions are considered. If you would like to only include upregulated genes in the condition of interest, you may use the argument geneset="up" in the function .

As for the ligands: by default, potential ligands are defined as genes expressed in at least 10% of the sender cell type (both conditions considered together) whose cognate receptors are also expressed in at least 10% of the receiver cell type. So this does not have any condition specificity in the function you are running. If you would like to only consider upregulated ligands in the analysis, you can follow the approach suggested here, or you can follow the prioritization approach here (which was the one referenced to in #220).

Hope this helps; feel free to reply to this issue if I misunderstood or if you have any further questions! :smile:

singlecellfan commented 1 month ago

Thanks for getting back to so quickly! Much appreciated.

I see, I must have misunderstood the first part. In fact I was only interested in the upregulated genes in the condition of interest. This is way I was a bit confused about the results.

I will try your suggestions and follow the other approaches linked. Thank you very much!