aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/ctl/ctl_analysis.py2
-rw-r--r--wqflask/wqflask/wgcna/wgcna_analysis.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/wqflask/ctl/ctl_analysis.py b/wqflask/wqflask/ctl/ctl_analysis.py
index e58a7b87..2a2124ca 100644
--- a/wqflask/wqflask/ctl/ctl_analysis.py
+++ b/wqflask/wqflask/ctl/ctl_analysis.py
@@ -194,7 +194,7 @@ class CTL(object):
def loadImage(self, path, name):
imgfile = open(self.results[path], 'rb')
imgdata = imgfile.read()
- imgB64 = imgdata.encode("base64")
+ imgB64 = base64.b64encode(imgdata)
bytesarray = array.array('B', imgB64)
self.results[name] = bytesarray
diff --git a/wqflask/wqflask/wgcna/wgcna_analysis.py b/wqflask/wqflask/wgcna/wgcna_analysis.py
index 0afe7e82..35fb3ec0 100644
--- a/wqflask/wqflask/wgcna/wgcna_analysis.py
+++ b/wqflask/wqflask/wgcna/wgcna_analysis.py
@@ -1,5 +1,6 @@
# WGCNA analysis for GN2
# Author / Maintainer: Danny Arends <Danny.Arends@gmail.com>
+import base64
import sys
import rpy2.robjects as ro # R Objects
import rpy2.rinterface as ri
@@ -163,8 +164,8 @@ class WGCNA(object):
print(("pre-loading imgage results:", self.results['imgloc']))
imgfile = open(self.results['imgloc'], 'rb')
imgdata = imgfile.read()
- imgB64 = imgdata.encode("base64")
bytesarray = array.array('B', imgB64)
+ imgB64 = base64.b64encode(imgdata)
self.results['imgdata'] = bytesarray
def process_results(self, results):