0
$\begingroup$

I am trying to find hub genes for modules made using WGCNA:

hub = chooseTopHubInEachModule(datExpr, moduleColors)

But I am getting error:

Error in hubs[m] <- colnames(adj)[hub] : replacement has length zero

Thank you for the help1

$\endgroup$
1
1
$\begingroup$

The most likely culprit here is that your expression data (the datExpr input to chooseTopHubInEachModule) has no colnames. Check that your data do have appropriate column names. Also check that the module color vector you supply has at least actual module (type table(moduleColors) and check that you have at least one module apart from "grey" or 0).

$\endgroup$
2
  • $\begingroup$ thanks as it worked. I have another question for extracting genes within modules of interest. I used unsigned network and interested in two modules for a trait. Earlier I made scatter plot and extracted the genes in all the modules. But now I only want to extract genes in these two modules for further analysis. I am not able to find a tutorial with more than one module. Can you please suggest something? Thank you1 $\endgroup$ Aug 27 at 16:20
  • $\begingroup$ Well, there are a few sections of the tutorial that may help. You can export the entire network analysis results (which you should do anyway) as illustrated in section 3d and then restrict the table (or just the gene identifiers) to the two modules you want. Alternatively, section 4a shows how to export gene identifiers in selected modules. $\endgroup$ Aug 28 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.