From af92bb48b2589d2804569863bc0306f787df1c60 Mon Sep 17 00:00:00 2001 From: Lei Yan Date: Sat, 22 Feb 2014 22:13:26 -0600 Subject: On branch master --- wqflask/maintenance/dataset/datastructure.py | 14 ++++++++++++++ wqflask/maintenance/dataset/load_genotypes.py | 11 ----------- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'wqflask/maintenance') diff --git a/wqflask/maintenance/dataset/datastructure.py b/wqflask/maintenance/dataset/datastructure.py index 0ee4b4ab..e1d88df2 100644 --- a/wqflask/maintenance/dataset/datastructure.py +++ b/wqflask/maintenance/dataset/datastructure.py @@ -66,6 +66,20 @@ def get_genofreeze_byinbredsetid(inbredsetid): cursor.execute(sql, (inbredsetid)) return cursor.fetchone() +def get_nextdataid_genotype(): + cursor, con = utilities.get_cursor() + sql = """ + SELECT GenoData.`Id` + FROM GenoData + ORDER BY GenoData.`Id` DESC + LIMIT 1 + """ + cursor.execute(sql) + re = cursor.fetchone() + dataid = re[0] + dataid += 1 + return dataid + def get_nextdataid_phenotype(): cursor, con = utilities.get_cursor() sql = """ diff --git a/wqflask/maintenance/dataset/load_genotypes.py b/wqflask/maintenance/dataset/load_genotypes.py index 124d3776..0e35fc24 100644 --- a/wqflask/maintenance/dataset/load_genotypes.py +++ b/wqflask/maintenance/dataset/load_genotypes.py @@ -55,17 +55,6 @@ def main(argv): print values return - # open db - host = 'localhost' - user = 'webqtl' - passwd = 'webqtl' - db = 'db_webqtl' - con = MySQLdb.Connect(db=db, user=user, passwd=passwd, host=host) - cursor = con.cursor() - # var - speciesid = int(argv[2]) - inbredsetid = int(argv[3]) - genofreezeid = int(argv[4]) sql = """ SELECT Id FROM GenoData -- cgit v1.2.3