smorabit / hdWGCNA

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

Why some grey-assigned genes dont have max value kME_grey? #165

Closed Brawni closed 6 months ago

Brawni commented 7 months ago

Hi!

Thanks again for the package, really cool. This is a question about the WGCNA algo i guess more than your single-cell implementation but i noticed that when i retrieve the module dataframe using function GetModules and then check kMEs for genes assigned to the grey module (aka not assigned to module) the large majority of them has higher values for other modules. Why have these not been assigned to highest kME module?

modules = GetModules (srt_wgcna)
modules2 = modules[, !colnames (modules) %in% c('gene_name','module','color')]
max_grey_genes = apply (modules2[, !colnames (modules2) %in% c('gene_name','module','color')], 1, function(x) colnames(modules2) [which.max(x)])
sum (max_grey_genes == 'kME_grey') ; sum (modules$module == 'grey') 
[1] 71
[1] 1278

Thanks!!

smorabit commented 6 months ago

Hi,

Good question, you may see some grey genes with higher kME in other modules because we are constructing the network and identifying modules based on the metacell expression matrix, whereas we are computing module eigengenes & kMEs in the single-cell dataset.

Brawni commented 6 months ago

oh that makes sense! thanks!