aboutsummaryrefslogtreecommitdiff
path: root/wqflask/maintenance
diff options
context:
space:
mode:
authorroot2014-02-20 13:59:41 -0600
committerroot2014-02-20 13:59:41 -0600
commit19e66ab781c7b0725b8739ecb1b5dc77d2537ec0 (patch)
tree89cb40715c4a4447a1e9d186bd23024b4b1ba131 /wqflask/maintenance
parentafbe7528993bd6fdca47dfbd045e7bd75a5b6609 (diff)
downloadgenenetwork2-19e66ab781c7b0725b8739ecb1b5dc77d2537ec0.tar.gz
Committer: root <root@alexandria.uthsc.edu>
On branch master
Diffstat (limited to 'wqflask/maintenance')
-rw-r--r--wqflask/maintenance/dataset/datastructure.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/wqflask/maintenance/dataset/datastructure.py b/wqflask/maintenance/dataset/datastructure.py
index 97d8f91f..ce588c78 100644
--- a/wqflask/maintenance/dataset/datastructure.py
+++ b/wqflask/maintenance/dataset/datastructure.py
@@ -58,8 +58,9 @@ def get_nextdataid_phenotype():
dataid = re[0]
dataid += 1
return dataid
-
+
def insert_strain(speciesid, strainname):
+ cursor = utilities.get_cursor()
sql = """
INSERT INTO Strain
SET
@@ -70,15 +71,16 @@ def insert_strain(speciesid, strainname):
cursor.execute(sql, (strainname, strainname, speciesid))
def get_strain(speciesid, strainname):
+ cursor = utilities.get_cursor()
sql = """
SELECT Strain.`Id`, Strain.`Name`
FROM Strain
WHERE Strain.`SpeciesId`=%s
AND Strain.`Name` LIKE %s
"""
- cursor.execute(sql1, (speciesid, strainname))
+ cursor.execute(sql, (speciesid, strainname))
return cursor.fetchone()
-
+
def get_strain_sure(speciesid, strainname):
strain = get_strain(speciesid, strainname)
if not strain:
@@ -86,5 +88,8 @@ def get_strain_sure(speciesid, strainname):
strain = get_strain(speciesid, strainname)
return strain
-def get_strains_bynames(strainnames)
- \ No newline at end of file
+def get_strains_bynames(speciesid, strainnames):
+ strains = []
+ for strainname in strainnames:
+ strains.append(get_strain_sure(speciesid, strainname))
+ return strains