aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorLei Yan2014-02-04 12:58:00 -0600
committerLei Yan2014-02-04 12:58:00 -0600
commita72c0f6426b50b87e3f940c13e91541e53af1cd1 (patch)
tree8357731c433fe204f52598b1bca68d7bed7e17cf /wqflask
parent1a9a509e0b73e9904b3f41246f3fc7f141375efe (diff)
downloadgenenetwork2-a72c0f6426b50b87e3f940c13e91541e53af1cd1.tar.gz
On branch master
Diffstat (limited to 'wqflask')
-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