cstoeckert / iterativeWGCNA

Extension of the WGCNA program to improve the eigengene similarity of modules and increase the overall number of genes in modules.
GNU General Public License v2.0
61 stars 17 forks source link

example code #30

Open wangjiawen2013 opened 5 years ago

wangjiawen2013 commented 5 years ago

Dear, Could you add some example code to iterativeWGCNA github, especially on the graphic visualization ?

wangjiawen2013 commented 5 years ago

And, after runing iterativeWGCNA with the following code: iterativeWGCNA -i data.txt --wgcnaParameters maxBlockSize=50000,nthreads=20 --enableWGCNAThreads

I got 15 pass (pass1 to pass 15) and more than 1,00 modules in final-membership.txt in total. I wonder if all the modules in the 15 pass must be used or only the last pass (pass15) be used to assign the membership ?

fossilfriend commented 5 years ago

Hi- apologies for taking so long to get back to you.

iterativeWGCNA has no built in visualizations at this time (although that is in the pipeline).

You can use WGCNA in R to get an approximate view of the results. Because iterativeWGCNA partitions the data for clustering (just likethe blockwise function of WGCNA) any clustering of the whole original dataset will still maintain some spurious correlations that were filtered out, so the dendrogram may not match exactly up to expectations, but it will be pretty good.

(the following are just suggested guidelines, you will have to make some adjustments)

  1. Load your expression data into R
  2. Filter out any genes are not in the final-membership.txt (ie..d, dropped by iterativeWGCNA)
  3. do the first steps standard wgcna analysis, making sure to adjust parameters to match any parameters you may have specified to iterativeWGCNA (in your case, you can go out of the box):
## where datExpr is your filtered expression data
simMatrix <- TOMsimilarityFromExpr(datExpr, networkType="signed")
dissMatrix <- 1 - simMatrix
## cluster
geneTree <- hclust(as.dist(dissMatrix))
  1. use labels2colors to map the module assignments (from final-membership.txt) to a color vector
  2. use the plotDendroAndColors to map your geneTree (dendrogram) to the module assignments