aboutsummaryrefslogtreecommitdiff
path: root/scripts
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
parent62a5047be6cee5f692d44f97410cab11a01e3396 (diff)
downloadgenenetwork3-3062aee581560ae1928d8e6077366fc072646677.tar.gz
add traits as columns names and pass as json input
Diffstat (limited to 'scripts')
-rw-r--r--scripts/wgcna_analysis.R18
-rw-r--r--scripts/wgcna_test_data.json3
2 files changed, 13 insertions, 8 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)
diff --git a/scripts/wgcna_test_data.json b/scripts/wgcna_test_data.json
index 7348b4e..1d469f4 100644
--- a/scripts/wgcna_test_data.json
+++ b/scripts/wgcna_test_data.json
@@ -1,4 +1,5 @@
{
+ "trait_names":["1455537_at","1425637_at","1449593_at","1421945_a_at","1450423_s_at","1423841_at","1451144_at"],
"trait_sample_data":[
{
"129S1/SvImJ": 7.142,
@@ -61,4 +62,4 @@
"minModuleSize": 30,
"corType": "pearson"
-} \ No newline at end of file
+}