aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/base/data_set.py2
-rw-r--r--wqflask/maintenance/gen_select_dataset.py4
-rw-r--r--wqflask/maintenance/quantile_normalize.py4
-rw-r--r--wqflask/maintenance/set_resource_defaults.py4
-rw-r--r--wqflask/utility/svg.py16
-rw-r--r--wqflask/wqflask/api/router.py14
-rw-r--r--wqflask/wqflask/collect.py2
-rw-r--r--wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py2
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py2
-rw-r--r--wqflask/wqflask/correlation_matrix/show_corr_matrix.py2
-rw-r--r--wqflask/wqflask/export_traits.py4
-rw-r--r--wqflask/wqflask/heatmap/heatmap.py4
-rw-r--r--wqflask/wqflask/marker_regression/display_mapping_results.py4
-rw-r--r--wqflask/wqflask/marker_regression/run_mapping.py2
-rw-r--r--wqflask/wqflask/network_graph/network_graph.py2
-rw-r--r--wqflask/wqflask/show_trait/show_trait.py2
-rw-r--r--wqflask/wqflask/user_manager.py2
-rw-r--r--wqflask/wqflask/views.py12
18 files changed, 42 insertions, 42 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 43beec26..8151a29d 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -44,7 +44,7 @@ import codecs
import json
import requests
import gzip
-import cPickle as pickle
+import pickle as pickle
import itertools
from redis import Redis
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py
index d12b328f..fd65a52a 100644
--- a/wqflask/maintenance/gen_select_dataset.py
+++ b/wqflask/maintenance/gen_select_dataset.py
@@ -50,7 +50,7 @@ from utility.tools import locate, locate_ignore_error, TEMPDIR, SQL_URI
import MySQLdb
import simplejson as json
-import urlparse
+import urllib.parse
#import sqlalchemy as sa
@@ -66,7 +66,7 @@ from pprint import pformat as pf
def parse_db_uri():
"""Converts a database URI to the db name, host name, user name, and password"""
- parsed_uri = urlparse.urlparse(SQL_URI)
+ parsed_uri = urllib.parse.urlparse(SQL_URI)
db_conn_info = dict(
db = parsed_uri.path[1:],
diff --git a/wqflask/maintenance/quantile_normalize.py b/wqflask/maintenance/quantile_normalize.py
index 43edfd13..4d6e03bf 100644
--- a/wqflask/maintenance/quantile_normalize.py
+++ b/wqflask/maintenance/quantile_normalize.py
@@ -6,7 +6,7 @@ sys.path.insert(0, './')
import MySQLdb
-import urlparse
+import urllib.parse
import numpy as np
import pandas as pd
@@ -22,7 +22,7 @@ from utility.tools import ELASTICSEARCH_HOST, ELASTICSEARCH_PORT, SQL_URI
def parse_db_uri():
"""Converts a database URI to the db name, host name, user name, and password"""
- parsed_uri = urlparse.urlparse(SQL_URI)
+ parsed_uri = urllib.parse.urlparse(SQL_URI)
db_conn_info = dict(
db = parsed_uri.path[1:],
diff --git a/wqflask/maintenance/set_resource_defaults.py b/wqflask/maintenance/set_resource_defaults.py
index d53a255b..abd5416c 100644
--- a/wqflask/maintenance/set_resource_defaults.py
+++ b/wqflask/maintenance/set_resource_defaults.py
@@ -34,7 +34,7 @@ Redis = get_redis_conn()
import MySQLdb
-import urlparse
+import urllib.parse
from utility.logger import getLogger
logger = getLogger(__name__)
@@ -42,7 +42,7 @@ logger = getLogger(__name__)
def parse_db_uri():
"""Converts a database URI to the db name, host name, user name, and password"""
- parsed_uri = urlparse.urlparse(SQL_URI)
+ parsed_uri = urllib.parse.urlparse(SQL_URI)
db_conn_info = dict(
db = parsed_uri.path[1:],
diff --git a/wqflask/utility/svg.py b/wqflask/utility/svg.py
index 19eda0ce..b92cc2d1 100644
--- a/wqflask/utility/svg.py
+++ b/wqflask/utility/svg.py
@@ -957,8 +957,8 @@ class drawing:
# Voeg een element toe aan de grafiek toe.
if use_dom_implementation==0:
def toXml(self, filename='',compress=False):
- import cStringIO
- xml=cStringIO.StringIO()
+ import io
+ xml=io.StringIO()
xml.write("<?xml version='1.0' encoding='UTF-8'?>\n")
xml.write("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\"")
if self.entity:
@@ -971,7 +971,7 @@ class drawing:
if not filename:
if compress:
import gzip
- f=cStringIO.StringIO()
+ f=io.StringIO()
zf=gzip.GzipFile(fileobj=f, mode='wb')
zf.write(xml.getvalue())
zf.close()
@@ -1024,12 +1024,12 @@ class drawing:
return elementroot
root=appender(self.svg, root)
if not filename:
- import cStringIO
- xml=cStringIO.StringIO()
+ import io
+ xml=io.StringIO()
PrettyPrint(root, xml)
if compress:
import gzip
- f=cStringIO.StringIO()
+ f=io.StringIO()
zf=gzip.GzipFile(fileobj=f, mode='wb')
zf.write(xml.getvalue())
zf.close()
@@ -1041,8 +1041,8 @@ class drawing:
try:
if filename[-4:]=='svgz':
import gzip
- import cStringIO
- xml=cStringIO.StringIO()
+ import io
+ xml=io.StringIO()
PrettyPrint(root, xml)
f=gzip.GzipFile(filename=filename, mode='wb', compresslevel=9)
f.write(xml.getvalue())
diff --git a/wqflask/wqflask/api/router.py b/wqflask/wqflask/api/router.py
index b81da0dc..5f9b81b8 100644
--- a/wqflask/wqflask/api/router.py
+++ b/wqflask/wqflask/api/router.py
@@ -6,7 +6,7 @@ import os, io, csv, json, datetime, requests, yaml
import zlib
from zipfile import ZipFile, ZIP_DEFLATED
-import StringIO
+import io
import flask
from flask import g, Response, request, make_response, render_template, send_from_directory, jsonify, redirect, send_file
@@ -308,7 +308,7 @@ def fetch_traits(dataset_name, file_format = "json"):
else:
filename = dataset_name + "_trait_ids.csv"
- si = StringIO.StringIO()
+ si = io.StringIO()
csv_writer = csv.writer(si)
csv_writer.writerows([[trait_id] for trait_id in trait_ids])
output = make_response(si.getvalue())
@@ -322,7 +322,7 @@ def fetch_traits(dataset_name, file_format = "json"):
else:
filename = dataset_name + "_trait_names.csv"
- si = StringIO.StringIO()
+ si = io.StringIO()
csv_writer = csv.writer(si)
csv_writer.writerows([[trait_name] for trait_name in trait_names])
output = make_response(si.getvalue())
@@ -413,7 +413,7 @@ def fetch_traits(dataset_name, file_format = "json"):
for result in g.db.execute(final_query).fetchall():
results_list.append(result)
- si = StringIO.StringIO()
+ si = io.StringIO()
csv_writer = csv.writer(si)
csv_writer.writerows(results_list)
output = make_response(si.getvalue())
@@ -519,7 +519,7 @@ def all_sample_data(dataset_name, file_format = "csv"):
results_list = list(map(list, zip(*results_list)))
- si = StringIO.StringIO()
+ si = io.StringIO()
csv_writer = csv.writer(si)
csv_writer.writerows(results_list)
output = make_response(si.getvalue())
@@ -706,7 +706,7 @@ def get_mapping_results():
if format == "csv":
filename = "mapping_" + datetime.datetime.utcnow().strftime("%b_%d_%Y_%I:%M%p") + ".csv"
- si = StringIO.StringIO()
+ si = io.StringIO()
csv_writer = csv.writer(si)
csv_writer.writerows(results)
output = make_response(si.getvalue())
@@ -732,7 +732,7 @@ def get_genotypes(group_name, file_format="csv", dataset_name=None):
if request.args['limit_to'].isdigit():
limit_num = int(request.args['limit_to'])
- si = StringIO.StringIO()
+ si = io.StringIO()
if file_format == "csv" or file_format == "geno":
filename = group_name + ".geno"
diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py
index 4c6e38e6..d77567f8 100644
--- a/wqflask/wqflask/collect.py
+++ b/wqflask/wqflask/collect.py
@@ -10,7 +10,7 @@ import uuid
import hashlib
import base64
-import urlparse
+import urllib.parse
import simplejson as json
diff --git a/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py b/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py
index 09d6b9cc..3e5daa50 100644
--- a/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py
+++ b/wqflask/wqflask/comparison_bar_chart/comparison_bar_chart.py
@@ -24,7 +24,7 @@ import sys
# sys.path.append(".") Never do this in a webserver!
import string
-import cPickle
+import pickle
import os
import time
import pp
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 4116e2df..65360040 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -23,7 +23,7 @@ from __future__ import absolute_import, print_function, division
import sys
import string
-import cPickle
+import pickle
import os
import time
import pp
diff --git a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
index b582cd23..ea786289 100644
--- a/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
+++ b/wqflask/wqflask/correlation_matrix/show_corr_matrix.py
@@ -24,7 +24,7 @@ import sys
# sys.path.append(".") Never do this in a webserver!
import string
-import cPickle
+import pickle
import os
import datetime
import time
diff --git a/wqflask/wqflask/export_traits.py b/wqflask/wqflask/export_traits.py
index a8b49829..2f4e9aac 100644
--- a/wqflask/wqflask/export_traits.py
+++ b/wqflask/wqflask/export_traits.py
@@ -2,7 +2,7 @@ from __future__ import print_function, division
import csv
import xlsxwriter
-import StringIO
+import io
import datetime
import itertools
@@ -63,7 +63,7 @@ def export_search_results_csv(targs):
file_list = []
for group in list(traits_by_group.keys()):
group_traits = traits_by_group[group]
- buff = StringIO.StringIO()
+ buff = io.StringIO()
writer = csv.writer(buff)
csv_rows = []
diff --git a/wqflask/wqflask/heatmap/heatmap.py b/wqflask/wqflask/heatmap/heatmap.py
index 577426b0..4fdc1f13 100644
--- a/wqflask/wqflask/heatmap/heatmap.py
+++ b/wqflask/wqflask/heatmap/heatmap.py
@@ -4,7 +4,7 @@ import sys
# sys.path.append(".") Never in a running webserver
import string
-import cPickle
+import pickle
import os
import datetime
import time
@@ -30,7 +30,7 @@ from utility.tools import flat_files, REAPER_COMMAND, TEMPDIR
from MySQLdb import escape_string as escape
-import cPickle as pickle
+import pickle as pickle
import simplejson as json
from pprint import pformat as pf
diff --git a/wqflask/wqflask/marker_regression/display_mapping_results.py b/wqflask/wqflask/marker_regression/display_mapping_results.py
index f282b010..f06db5d5 100644
--- a/wqflask/wqflask/marker_regression/display_mapping_results.py
+++ b/wqflask/wqflask/marker_regression/display_mapping_results.py
@@ -29,8 +29,8 @@ import string
from math import *
from PIL import (Image, ImageDraw, ImageFont, ImageColor)
import sys, os
-import cPickle
-import httplib
+import pickle
+import http.client
import json
from flask import Flask, g
diff --git a/wqflask/wqflask/marker_regression/run_mapping.py b/wqflask/wqflask/marker_regression/run_mapping.py
index 1e6dff57..67512bc6 100644
--- a/wqflask/wqflask/marker_regression/run_mapping.py
+++ b/wqflask/wqflask/marker_regression/run_mapping.py
@@ -18,7 +18,7 @@ import uuid
import rpy2.robjects as ro
import numpy as np
-import cPickle as pickle
+import pickle as pickle
import itertools
import simplejson as json
diff --git a/wqflask/wqflask/network_graph/network_graph.py b/wqflask/wqflask/network_graph/network_graph.py
index ac2ff017..7916651f 100644
--- a/wqflask/wqflask/network_graph/network_graph.py
+++ b/wqflask/wqflask/network_graph/network_graph.py
@@ -23,7 +23,7 @@ from __future__ import absolute_import, print_function, division
import sys
import string
-import cPickle
+import pickle
import os
import time
import pp
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 65899ab2..738aa28a 100644
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, print_function, division
import string
import os
import datetime
-import cPickle
+import pickle
import uuid
import requests
import json as json
diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py
index 232cb8da..56d1c084 100644
--- a/wqflask/wqflask/user_manager.py
+++ b/wqflask/wqflask/user_manager.py
@@ -9,7 +9,7 @@ import uuid
import hashlib
import hmac
import base64
-import urlparse
+import urllib.parse
import simplejson as json
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 92c20fc7..83d5202e 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -14,13 +14,13 @@ import csv
import simplejson as json
import yaml
import xlsxwriter
-import StringIO # Todo: Use cStringIO?
+import io # Todo: Use cStringIO?
from zipfile import ZipFile, ZIP_DEFLATED
import gc
import numpy as np
-import cPickle as pickle
+import pickle as pickle
import uuid
import flask
@@ -373,7 +373,7 @@ def export_trait_excel():
logger.info("sample_data - type: %s -- size: %s" % (type(sample_data), len(sample_data)))
- buff = StringIO.StringIO()
+ buff = io.StringIO()
workbook = xlsxwriter.Workbook(buff, {'in_memory': True})
worksheet = workbook.add_worksheet()
for i, row in enumerate(sample_data):
@@ -397,7 +397,7 @@ def export_trait_csv():
logger.info("sample_data - type: %s -- size: %s" % (type(sample_data), len(sample_data)))
- buff = StringIO.StringIO()
+ buff = io.StringIO()
writer = csv.writer(buff)
for row in sample_data:
writer.writerow(row)
@@ -417,7 +417,7 @@ def export_traits_csv():
file_list = export_traits.export_search_results_csv(request.form)
if len(file_list) > 1:
- memory_file = StringIO.StringIO()
+ memory_file = io.StringIO()
with ZipFile(memory_file, mode='w', compression=ZIP_DEFLATED) as zf:
for the_file in file_list:
zf.writestr(the_file[0], the_file[1])
@@ -460,7 +460,7 @@ def export_perm_data():
["#Comment: Results sorted from low to high peak linkage"]
]
- buff = StringIO.StringIO()
+ buff = io.StringIO()
writer = csv.writer(buff)
writer.writerows(the_rows)
for item in perm_info['perm_data']: