aboutsummaryrefslogtreecommitdiff
path: root/scripts/wgcna_analysis.R
diff options
context:
space:
mode:
authorAlexander Kabui2021-09-23 21:27:42 +0300
committerAlexander Kabui2021-09-23 21:27:42 +0300
commit3062aee581560ae1928d8e6077366fc072646677 (patch)
tree57ba02ca8c199fe1c78a82a0b16dcc4a16e92df1 /scripts/wgcna_analysis.R
parent62a5047be6cee5f692d44f97410cab11a01e3396 (diff)
downloadgenenetwork3-3062aee581560ae1928d8e6077366fc072646677.tar.gz
add traits as columns names and pass as json input
Diffstat (limited to 'scripts/wgcna_analysis.R')
-rw-r--r--scripts/wgcna_analysis.R18
1 files changed, 11 insertions, 7 deletions
diff --git a/scripts/wgcna_analysis.R b/scripts/wgcna_analysis.R
index c3b1ac8..e641652 100644
--- a/scripts/wgcna_analysis.R
+++ b/scripts/wgcna_analysis.R
@@ -53,6 +53,8 @@ dataExpr <- dataExpr[gsg$goodSamples, gsg$goodGenes]
## network constructions and modules
+names(dataExpr) = inputData$trait_names
+
# Allow multi-threading within WGCNA
enableWGCNAThreads()
@@ -82,6 +84,7 @@ network <- blockwiseModules(dataExpr,
TOMtype = TOMtype,
#module indentification
+ verbose = 3,
minmodulesSize = minModuleSize,
deepSplit = 3,
@@ -108,13 +111,14 @@ dendroLabels = FALSE, hang = 0.03,
addGuide = TRUE, guideHang = 0.05)
-
-
-json_data <- list(input = inputData,output = list(ModEigens=network$MEs,soft_threshold=sft$fitIndices,
- blockGenes =network$blockGenes[[1]],
- net_colors =network$colors,
- net_unmerged=network$unmergedColors,
- imageLoc=imageLoc))
+json_data <- list(input = inputData,
+ output = list(ModEigens=network$MEs,
+ soft_threshold=sft$fitIndices,
+ blockGenes =network$blockGenes[[1]],
+ net_colors =network$colors,
+ power_used_for_analy=powerEst,
+ net_unmerged=network$unmergedColors,
+ imageLoc=imageLoc))
json_data <- toJSON(json_data)