smorabit / hdWGCNA

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

How do I choose some modules for HubGeneNetworkPlot plotting #198

Closed DelongZHOU closed 3 months ago

DelongZHOU commented 4 months ago

Hi Sam, I'm trying to plot the hub genes network but only for selected modules. The code I'm using is

p<-HubGeneNetworkPlot(seurat_obj, n_hubs = 3, n_other=5, edge_prop = 0.75, mods = c('M1','M2','M3') )

but I got this error:

Error in if (mods == "all") { : the condition has length > 1

I suppose it's because I'm trying to compare an array vs single value and it returns an array of boolean. What should be the correct syntax for this parameter? Thanks!

ps I appreciate your effort of maintaining and updating the package. I'll reply to your comments on my other issues in a few days!

smorabit commented 3 months ago

Hi,

I found an issue with this function that was causing this error message, and I think that I fixed it in the latest update. Please let me know if it works for you.