12.07.2015 Views

Tutorial for the WGCNA package for R - UCLA Human Genetics

Tutorial for the WGCNA package for R - UCLA Human Genetics

Tutorial for the WGCNA package for R - UCLA Human Genetics

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

We choose a height cut of 0.25, corresponding to correlation of 0.75, to merge (see Fig. 4):MEDissThres = 0.25# Plot <strong>the</strong> cut line into <strong>the</strong> dendrogramabline(h=MEDissThres, col = "red")# Call an automatic merging functionmerge = mergeCloseModules(datExpr, dynamicColors, cutHeight = MEDissThres, verbose = 3)# The merged module colorsmergedColors = merge$colors;# Eigengenes of <strong>the</strong> new merged modules:mergedMEs = merge$newMEs;To see what <strong>the</strong> merging did to our module colors, we plot <strong>the</strong> gene dendrogram again, with <strong>the</strong> original and mergedmodule colors underneath (Figure 5).sizeGrWindow(12, 9)#pdf(file = "Plots/geneDendro-3.pdf", wi = 9, he = 6)plotDendroAndColors(geneTree, cbind(dynamicColors, mergedColors),c("Dynamic Tree Cut", "Merged dynamic"),dendroLabels = FALSE, hang = 0.03,addGuide = TRUE, guideHang = 0.05)#dev.off()In <strong>the</strong> subsequent analysis, we will use <strong>the</strong> merged module colors in mergedColors. We save <strong>the</strong> relevant variables <strong>for</strong>use in subsequent parts of <strong>the</strong> tutorial:# Rename to moduleColorsmoduleColors = mergedColors# Construct numerical labels corresponding to <strong>the</strong> colorscolorOrder = c("grey", standardColors(50));moduleLabels = match(moduleColors, colorOrder)-1;MEs = mergedMEs;# Save module colors and labels <strong>for</strong> use in subsequent partssave(MEs, moduleLabels, moduleColors, geneTree, file = "FemaleLiver-02-networkConstruction-stepByStep.RData")References[1] B. Zhang and S. Horvath. A general framework <strong>for</strong> weighted gene co-expression network analysis. StatisticalApplications in <strong>Genetics</strong> and Molecular Biology, 4(1):Article 17, 2005.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!