about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDannyArends2015-10-07 14:59:27 +0200
committerDannyArends2015-10-07 14:59:27 +0200
commitce847df45dacefd2727ee05c58b54863251f2d5b (patch)
tree99b4dc90ecc8843f1dec89e754fda1a976531f3f
parent4fb33d2ead790421957faeec0a6874f826a7cb9d (diff)
downloadgenenetwork2-ce847df45dacefd2727ee05c58b54863251f2d5b.tar.gz
Passing more information calculated by WGCNA to the results page
-rw-r--r--wqflask/wqflask/wgcna/wgcna_analysis.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/wqflask/wqflask/wgcna/wgcna_analysis.py b/wqflask/wqflask/wgcna/wgcna_analysis.py
index 9ab7950b..0cf4eeaf 100644
--- a/wqflask/wqflask/wgcna/wgcna_analysis.py
+++ b/wqflask/wqflask/wgcna/wgcna_analysis.py
@@ -74,6 +74,7 @@ class WGCNA(object):
         # Transfer the load data from python to R
         uStrainsR = r_unique(ro.Vector(strains))    # Unique strains in R vector
         uTraitsR = r_unique(ro.Vector(traits))      # Unique traits in R vector
+        self.phenotypes = uTraitsR
 
         r_cat("The number of unique strains:", r_length(uStrainsR), "\n")
         r_cat("The number of unique traits:", r_length(uTraitsR), "\n")
@@ -93,7 +94,7 @@ class WGCNA(object):
         self.results = {}
         # Calculate a good soft threshold
         powers = r_c(r_c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), r_seq(12, 20, 2))
-        sft    = self.r_pickSoftThreshold(rM, powerVector = powers, verbose = 5)
+        self.sft    = self.r_pickSoftThreshold(rM, powerVector = powers, verbose = 5)
 
         # Create block wise modules using WGCNA
         network = self.r_blockwiseModules(rM, power = 6, verbose = 3)
@@ -125,6 +126,8 @@ class WGCNA(object):
         print("Processing WGCNA output")
         template_vars = {}
         template_vars["input"] = self.input
+        template_vars["phenotypes"] = self.phenotypes
+        template_vars["powers"] = self.sft[1:]                      # Results from the soft threshold analysis
         template_vars["results"] = self.results
         self.render_image(results)
         sys.stdout.flush()