From a72c0f6426b50b87e3f940c13e91541e53af1cd1 Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Tue, 4 Feb 2014 12:58:00 -0600 Subject: On branch master --- wqflask/maintenance/dataset/probesets.py | 17 +++++++++++++++-- wqflask/maintenance/dataset/utilities.py | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/wqflask/maintenance/dataset/probesets.py b/wqflask/maintenance/dataset/probesets.py index 4da2b2ef..23257f7e 100644 --- a/wqflask/maintenance/dataset/probesets.py +++ b/wqflask/maintenance/dataset/probesets.py @@ -96,9 +96,22 @@ inbredsetid=1 results = get_normalized_probeset(locus=locus, inbredsetid=inbredsetid) file = open('probesets_%s.txt' % (locus), 'w+') -file.write("GN dataset ID\t\n") +file.write("GN dataset ID\t") +file.write('\n') file.flush() for row in results: - file.write(str(row[0])) + file.write("%s\t" % (row[0])) + file.write("%s\t" % (utilities.clearspaces(row[2], default=''))) + file.write("%s\t" % (utilities.clearspaces(row[3], default=''))) + file.write("%s\t" % (utilities.clearspaces(row[4], default=''))) + file.write("%s\t" % (utilities.clearspaces(row[5], default=''))) + file.write("%s\t" % (utilities.clearspaces(row[6], default=''))) + file.write("%s\t" % (utilities.clearspaces(row[7], default=''))) + file.write("%s\t" % (row[8])) + file.write("%s\t" % (row[9])) + file.write("%s\t" % (row[10])) + file.write("%s\t" % (utilities.clearspaces(row[11], default=''))) + file.write("%s\t" % (row[12])) + file.write('\n') file.flush() file.close() diff --git a/wqflask/maintenance/dataset/utilities.py b/wqflask/maintenance/dataset/utilities.py index 5ffa9047..6033d7b4 100644 --- a/wqflask/maintenance/dataset/utilities.py +++ b/wqflask/maintenance/dataset/utilities.py @@ -10,10 +10,10 @@ def get_cursor(): cursor = con.cursor() return cursor -def clearspaces(s): +def clearspaces(s, default=None): if s: s = re.sub('\s+', ' ', s) s = s.strip() return s else: - return None + return default -- cgit v1.2.3