From 655343aded3ece533f267bd9fd16aadf0cefff02 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 23 Sep 2021 12:49:40 +0300 Subject: add mock test data for script --- scripts/wgcna_test_data.json | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 scripts/wgcna_test_data.json (limited to 'scripts/wgcna_test_data.json') diff --git a/scripts/wgcna_test_data.json b/scripts/wgcna_test_data.json new file mode 100644 index 0000000..7348b4e --- /dev/null +++ b/scripts/wgcna_test_data.json @@ -0,0 +1,64 @@ +{ + "trait_sample_data":[ + { + "129S1/SvImJ": 7.142, + "A/J": 7.31, + "AKR/J": 7.49, + "B6D2F1": 6.899, + "BALB/cByJ": 7.172, + "BALB/cJ": 7.396 + }, + { + "129S1/SvImJ": 7.071, + "A/J": 7.05, + "AKR/J": 7.313, + "B6D2F1": 6.999, + "BALB/cByJ": 7.293, + "BALB/cJ": 7.117 + }, + { + "129S1/SvImJ": 7.221, + "A/J": 7.246, + "AKR/J": 7.754, + "B6D2F1": 6.866, + "BALB/cByJ": 6.752, + "BALB/cJ": 7.269 + }, + { + "129S1/SvImJ": 9.221, + "A/J": 9.246, + "AKR/J": 9.954, + "B6D2F1": 6.866, + "BALB/cByJ": 6.952, + "BALB/cJ": 9.269 + }, + { + "129S1/SvImJ": 7.221, + "A/J": 7.246, + "AKR/J": 7.754, + "B6D2F1": 6.866, + "BALB/cByJ": 6.752, + "BALB/cJ": 7.269 + }, + { + "129S1/SvImJ": 7.221, + "A/J": 7.246, + "AKR/J": 7.754, + "B6D2F1": 6.866, + "BALB/cByJ": 6.752, + "BALB/cJ": 7.269 + }, + { + "129S1/SvImJ": 11.221, + "A/J": 11.246, + "AKR/J": 11.1154, + "B6D2F1": 6.866, + "BALB/cByJ": 6.1152, + "BALB/cJ": 11.269 + } + ], + "TOMtype": "unsigned", + "minModuleSize": 30, + "corType": "pearson" + +} \ No newline at end of file -- cgit v1.2.3 From 3062aee581560ae1928d8e6077366fc072646677 Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Thu, 23 Sep 2021 21:27:42 +0300 Subject: add traits as columns names and pass as json input --- scripts/wgcna_analysis.R | 18 +++++++++++------- scripts/wgcna_test_data.json | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'scripts/wgcna_test_data.json') 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 +} -- cgit v1.2.3