aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance/dataset
diff options
context:
space:
mode:
authorroot2014-02-20 15:19:59 -0600
committerroot2014-02-20 15:19:59 -0600
commit153ec8f16c3d9ef936e244c568751788d1413a62 (patch)
tree4d1b866e979458305b3c1553f5422fa851fdeead /wqflask/maintenance/dataset
parent34cb91c7bb4f49156e60d3b67318834c10f8d0f0 (diff)
downloadgenenetwork2-153ec8f16c3d9ef936e244c568751788d1413a62.tar.gz
Committer: root <root@alexandria.uthsc.edu>
On branch master
Diffstat (limited to 'wqflask/maintenance/dataset')
-rw-r--r--wqflask/maintenance/dataset/load_phenotypes.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/wqflask/maintenance/dataset/load_phenotypes.py b/wqflask/maintenance/dataset/load_phenotypes.py
index 740fc9b5..44876d53 100644
--- a/wqflask/maintenance/dataset/load_phenotypes.py
+++ b/wqflask/maintenance/dataset/load_phenotypes.py
@@ -110,7 +110,40 @@ def main(argv):
publicationid = con.insert_id()
print "INSERT INTO Publication: %d record: %d" % (rowcount, publicationid)
# data
-
+ for index, strain in enumerate(strains):
+ #
+ strainid = strain[0]
+ value = utilities.to_db_float(datarow_value[index+1], None)
+ se = utilities.to_db_float(datarow_se[index+1], None)
+ n = utilities.to_db_int(datarow_n[index+1], None)
+ #
+ if value:
+ sql = """
+ INSERT INTO PublishData
+ SET
+ PublishData.`Id`=%s,
+ PublishData.`StrainId`=%s,
+ PublishData.`value`=%s
+ """
+ cursor.execute(sql, (dataid, strainid, value))
+ if se:
+ sql = """
+ INSERT INTO PublishSE
+ SET
+ PublishSE.`DataId`=%s,
+ PublishSE.`StrainId`=%s,
+ PublishSE.`error`=%s
+ """
+ cursor.execute(sql, (dataid, strainid, se))
+ if n:
+ sql = """
+ INSERT INTO NStrain
+ SET
+ NStrain.`DataId`=%s,
+ NStrain.`StrainId`=%s,
+ NStrain.`count`=%s
+ """
+ cursor.execute(sql, (dataid, strainid, n))
if __name__ == "__main__":
print "command line arguments:\n\t%s" % sys.argv