jackbibby1 / SCPA

R package for pathway analysis in scRNA-seq data
https://jackbibby1.github.io/SCPA/
GNU General Public License v3.0
57 stars 6 forks source link

FC calculation in compare_pathways() #81

Open neogilab opened 1 month ago

neogilab commented 1 month ago

What's going on I want to find pathways regulated in HIV infected cell population compared healthy cell populations. I am able to run the analysis using the below code. I have question about the order of cell populations to be given in the function. As per the given below command can I say, pathways with positive FC values are increased in HIV (Up regulated) and those with negative FC values are decreased in HIV (Down regulated)

Code to replicate the issue

healthy <- seurat_extract(MonoData$Control, meta1 = "cluster", value_meta1 = 1) 
hiv <- seurat_extract(MonoData$HIV,  meta1 = "cluster", value_meta1 =1)
scpa_out <- compare_pathways(list(hiv,healthy), pathways="KEGG_2021.gmt")
jackbibby1 commented 1 month ago

Hi,

If you run ?compare_pathways there's some more explanation on this:

Value Statistical results from the SCPA analysis. The qval should be the primary metric that is used to interpret pathway differences i.e. a higher qval translates to larger pathway differences between conditions. If only two samples are provided, a fold change (FC) enrichment score will also be calculated. The FC statistic is generated from a running sum of mean changes in gene expression from all genes of the pathway. It's calculated from average pathway expression in population1 - population2, so a negative FC means the pathway is higher in population2.

Is that what you're looking for?

Jack

neogilab commented 1 month ago

Hi, Thank you for the response. Yes, I have seen the function description. I just want to confirm the order of population to be given in the function. The description says FC = exp(population1) - exp(population2). So positive value means the pathway is higher in population 1 and negative value means the pathway is lower in population1.

So when we give, scpa_out <- compare_pathways(list(hiv,healthy), pathways="KEGG_2021.gmt")

The population 1 is "hiv" and population 2 is "healthy". So pathway with negative FC means those are decreased in HIV, right? But we obtained many pathways those are supposed to be increased in HIV, but with negative FC values.

So we just want to confirm the order of populations is correct and the results we are getting because of biological reason.

jackbibby1 commented 1 month ago

Yup, that's right. A negative fold case in your situation would mean higher in healthy (or lower in hiv). I would pay more attention to the qval and adjusted pvalue output to inform the significance of the change and then consider the fold change value as secondary