aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance
diff options
context:
space:
mode:
authorLei Yan2014-01-25 00:02:55 -0600
committerLei Yan2014-01-25 00:02:55 -0600
commitd4c4f9566555f54e877237a99d72c71840880293 (patch)
tree4343bf6760e75b353561c70120f01eb5b94977f4 /wqflask/maintenance
parentb9acdec0979bedb05240bc4bf9284ff00e29387a (diff)
downloadgenenetwork2-d4c4f9566555f54e877237a99d72c71840880293.tar.gz
On branch master
Diffstat (limited to 'wqflask/maintenance')
-rw-r--r--wqflask/maintenance/dataset/phenotypes/phenotypes.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/wqflask/maintenance/dataset/phenotypes/phenotypes.py b/wqflask/maintenance/dataset/phenotypes/phenotypes.py
index 843b2dfd..08fc1432 100644
--- a/wqflask/maintenance/dataset/phenotypes/phenotypes.py
+++ b/wqflask/maintenance/dataset/phenotypes/phenotypes.py
@@ -36,7 +36,9 @@ def fetch():
strains.append(strain)
print "get %d strains: %s" % (len(strains), strains)
phenotypesfile.write('\t'.join([strain.upper() for strain in strains]))
- #
+ phenotypesfile.write('\n')
+ phenotypesfile.flush()
+ # phenotypes
sql = """
SELECT PublishXRef.`Id`, Phenotype.`Original_description`, Phenotype.`Pre_publication_description`, Phenotype.`Post_publication_description`
FROM (PublishXRef, Phenotype)
@@ -51,6 +53,7 @@ def fetch():
original_description = phenotyperow[1]
pre_publication_description = phenotyperow[2]
post_publication_description = phenotyperow[3]
+ phenotypesfile.write("%s\t%s\t%s\t%s\t" % (publishxrefid, original_description, pre_publication_description, post_publication_description))
sql = """
SELECT Strain.Name, PublishData.value
FROM (PublishXRef, PublishData, Strain)
@@ -62,8 +65,13 @@ def fetch():
cursor.execute(sql, (inbredsetid, publishxrefid))
results = cursor.fetchall()
print "get %d values" % (len(results))
+ strainvaluedic = {}
for strainvalue in results:
- print strainvalue
+ strainname = strainvalue[0]
+ strainname = strainname.lower()
+ value = strainvalue[1]
+ strainvaluedic[strainname] = value
+ print strainvaluedic
break
# release
phenotypesfile.close()