smorabit / hdWGCNA

High dimensional weighted gene co-expression network analysis
https://smorabit.github.io/hdWGCNA/
Other
315 stars 31 forks source link

Question about pct.1 and pct.2 from FindDMEs #259

Closed DelongZHOU closed 1 week ago

DelongZHOU commented 2 weeks ago

Hi Sam,

I'm wondering how the pct.1 and 2 are calculated. As I understand it, ModuleEigengenes calculates the ME or hME for all modules in each gene in each (original) cell (not meta cell); then FindDMEs treat the ME of each module as a gene expression and uses Seurat's FindMarkers to decide whether the module in question is differentially expressed. In this case, the pct.1 and 2 indicates the fraction of cells expressing the modules in each group. So my question is, to what extent the genes in the modules have to be expressed for hdWGCNA to give a non zero value of ME? For example, if only one gene out of a module of 1000 genes is detected with 1 read in a cell, does that make the ME non zero in that cell?

For some modules I see a big difference between pct.1 and pct.2, I want to make sure there is indeed big difference in the fraction of cells that express a group of genes. If one gene is enough to for the ME that's quite a powerful difference.

Thank you!

smorabit commented 2 weeks ago

Hi,

Regarding pct.1 and pct.2, they are computed the exact same way that Seurat computes them in FindMarkers. You can think about this as the proportion of cells with a non-zero ME value. For example if pct.1 = 0.5, 50% of the cells in group 1 have a non-zero ME value.

So my question is, to what extent the genes in the modules have to be expressed for hdWGCNA to give a non zero value of ME?

At this time I don't have an answer for this question, this would require some new testing and analysis.

For example, if only one gene out of a module of 1000 genes is detected with 1 read in a cell, does that make the ME non zero in that cell?

Just speculating but I do not think this would have a positive value.

DelongZHOU commented 1 week ago

Hi Sam,

Just to clarify a few things: So the pct.1/2 is indeed following the same logic as FindMarkers, but are taking pos scores instead of non zero scores?

I just checked my data, for one module the results is pct1=0.502, pct2=0.293. By manually subsetting the ME table I found exactly the same values for positive MEs. There are no cells with exact zero ME values and the rest are all negative.

And for the DMEI suppose both positive and negative ME are all taken into account?

Finally I plotted the expression of some hub genes in cells with pos vs neg ME, and it seems that the genes are still expressed in the neg ME cells but much lower than the pos cells.

psy l56np21 hub=12 dot

smorabit commented 1 week ago

So the pct.1/2 is indeed following the same logic as FindMarkers, but are taking pos scores instead of non zero scores?

Apologies for the confusion but I meant to say positive values, not non-zero values.

And for the DMEI suppose both positive and negative ME are all taken into account?

At this time only positive ME values are used, anything lower than zero is set to zero for this analysis. I remember when I originally wrote this function I was having issues when I was using both negative and positive values, however I can try again and maybe have it as an option for this function.

DelongZHOU commented 1 week ago

Thank you!