aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Kabui2021-09-23 14:37:48 +0300
committerAlexander Kabui2021-09-23 14:37:48 +0300
commitfc335fa1394a39d1f9f397cb69c755040ecfc5e1 (patch)
treedcb880f8d6850c01b84b9a793470ff0f0ebd161a /scripts
parenteb2277a5fc96795bf6432e392e62601a3cf94058 (diff)
downloadgenenetwork3-fc335fa1394a39d1f9f397cb69c755040ecfc5e1.tar.gz
append input to output
Diffstat (limited to 'scripts')
-rw-r--r--scripts/wgcna_analysis.R16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/wgcna_analysis.R b/scripts/wgcna_analysis.R
index 86ddffb..ee749e9 100644
--- a/scripts/wgcna_analysis.R
+++ b/scripts/wgcna_analysis.R
@@ -20,19 +20,19 @@ if (length(args)==0) {
json_file_path = args[1]
}
-results <- fromJSON(file = json_file_path)
+inputData <- fromJSON(file = json_file_path)
# parse the json data input
-minModuleSize <-results$minModuleSize
+minModuleSize <-inputData$minModuleSize
-TOMtype <-results$TOMtype
+TOMtype <-inputData$TOMtype
-corType <-results$corType
+corType <-inputData$corType
#
-trait_sample_data <- do.call(rbind, results$trait_sample_data)
+trait_sample_data <- do.call(rbind, inputData$trait_sample_data)
dataExpr <- data.frame(apply(trait_sample_data, 2, function(x) as.numeric(as.character(x))))
# transform expressionData
@@ -102,12 +102,12 @@ addGuide = TRUE, guideHang = 0.05)
-json_data <- list(ModEigens=network$MEs,soft_threshold=sft$fitIndices,
+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)
+ imageLoc=imageLoc))
json_data <- toJSON(json_data)
-write(json_data,"./output.json") \ No newline at end of file
+write(json_data,file= json_file_path) \ No newline at end of file