diff options
author | root | 2014-02-19 17:07:46 -0600 |
---|---|---|
committer | root | 2014-02-19 17:07:46 -0600 |
commit | afbe7528993bd6fdca47dfbd045e7bd75a5b6609 (patch) | |
tree | 5779c69ac8e3dec692cfbbaef98f8eacc1d0d355 /wqflask/maintenance/dataset/datastructure.py | |
parent | 13b090fc47504c2ddf73f38cd16aa67f0f41d4ba (diff) | |
download | genenetwork2-afbe7528993bd6fdca47dfbd045e7bd75a5b6609.tar.gz |
Committer: root <root@alexandria.uthsc.edu>
On branch master
Diffstat (limited to 'wqflask/maintenance/dataset/datastructure.py')
-rw-r--r-- | wqflask/maintenance/dataset/datastructure.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/wqflask/maintenance/dataset/datastructure.py b/wqflask/maintenance/dataset/datastructure.py index 9f1433e2..97d8f91f 100644 --- a/wqflask/maintenance/dataset/datastructure.py +++ b/wqflask/maintenance/dataset/datastructure.py @@ -58,3 +58,33 @@ def get_nextdataid_phenotype(): dataid = re[0] dataid += 1 return dataid + +def insert_strain(speciesid, strainname): + sql = """ + INSERT INTO Strain + SET + Strain.`Name`=%s, + Strain.`Name2`=%s, + Strain.`SpeciesId`=%s + """ + cursor.execute(sql, (strainname, strainname, speciesid)) + +def get_strain(speciesid, strainname): + sql = """ + SELECT Strain.`Id`, Strain.`Name` + FROM Strain + WHERE Strain.`SpeciesId`=%s + AND Strain.`Name` LIKE %s + """ + cursor.execute(sql1, (speciesid, strainname)) + return cursor.fetchone() + +def get_strain_sure(speciesid, strainname): + strain = get_strain(speciesid, strainname) + if not strain: + insert_strain(speciesid, strainame) + strain = get_strain(speciesid, strainname) + return strain + +def get_strains_bynames(strainnames) +
\ No newline at end of file |