aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/maintenance')
-rw-r--r--wqflask/maintenance/dataset/probesets.py17
-rw-r--r--wqflask/maintenance/dataset/utilities.py4
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