From 30a77dd32c07d05a43ddbc34b88e59bc93f4d240 Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Wed, 12 Feb 2014 21:50:53 -0600 Subject: On branch master --- wqflask/maintenance/dataset/specials3.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'wqflask/maintenance/dataset') diff --git a/wqflask/maintenance/dataset/specials3.py b/wqflask/maintenance/dataset/specials3.py index 8d878ed4..727e32f2 100644 --- a/wqflask/maintenance/dataset/specials3.py +++ b/wqflask/maintenance/dataset/specials3.py @@ -79,6 +79,7 @@ def generate_probesets(probesetfreezesfile, outputdir): outputfile = open("%s/%d_%s.txt" % (outputdir, probesetfreezeid, probesetfreezename), "w+") outputfile.write("%s\t" % "ProbeSet Id") outputfile.write("%s\t" % "ProbeSet Name") + outputfile.write('\t'.join([strain[1].upper() for strain in strains])) outputfile.write("\n") outputfile.flush() # @@ -86,15 +87,24 @@ def generate_probesets(probesetfreezesfile, outputdir): print probesetfreeze print len(probesetxrefs) for probesetxref in probesetxrefs: - pass - # - probesetid = probesetxref[0] - probesetdataid = probesetxref[1] - probeset = probesets.get_probeset(probesetid) - probesetname = probeset[1] - probesetdata = probesets.get_probesetdata(probesetdataid) - probesetdata = zip(*probesetdata) - probesetdata = utilities.to_dic([strain.lower() for strain in probesetdata[1]], probesetdata[2]) + probesetid = probesetxref[0] + probesetdataid = probesetxref[1] + probeset = probesets.get_probeset(probesetid) + probesetname = probeset[1] + probesetdata = probesets.get_probesetdata(probesetdataid) + probesetdata = zip(*probesetdata) + probesetdata = utilities.to_dic([strain.lower() for strain in probesetdata[1]], probesetdata[2]) + # + for strain in strains: + strainname = strain[1] + strainname = strainname.lower() + if strainname in probesetdata: + value = probesetdata[strainname] + else: + value = 'x' + outputfile.write("%s\t" % value) + outputfile.write("\n") + outputfile.flush() # outputfile.close() file.close() -- cgit v1.2.3