diff options
author | Lei Yan | 2014-01-31 16:57:30 -0600 |
---|---|---|
committer | Lei Yan | 2014-01-31 16:57:30 -0600 |
commit | c1bd0f562b5249b9a6911e3873dad8dd853aaab7 (patch) | |
tree | bd79e5b527a9a584d1f2aab6c7fb901a26d26dd9 | |
parent | d6543befcdaf4786f42c10c1cdd0cb473a8d8453 (diff) | |
download | genenetwork2-c1bd0f562b5249b9a6911e3873dad8dd853aaab7.tar.gz |
On branch master
-rw-r--r-- | wqflask/maintenance/dataset/datastructure/datastructure.py | 7 | ||||
-rw-r--r-- | wqflask/maintenance/dataset/probesets/probesets.py | 45 |
2 files changed, 47 insertions, 5 deletions
diff --git a/wqflask/maintenance/dataset/datastructure/datastructure.py b/wqflask/maintenance/dataset/datastructure/datastructure.py index ed429cb4..73e1c0d8 100644 --- a/wqflask/maintenance/dataset/datastructure/datastructure.py +++ b/wqflask/maintenance/dataset/datastructure/datastructure.py @@ -4,8 +4,8 @@ sys.path.append('..') from utilities import db -def get_type(inbredsetid): - cursor=db.get_cursor() +def get_probesetfreeze(inbredsetid): + cursor = db.get_cursor() sql = """ SELECT ProbeSetFreeze.`Id`, ProbeSetFreeze.`Name`, ProbeSetFreeze.`FullName` FROM ProbeSetFreeze, ProbeFreeze @@ -14,7 +14,4 @@ def get_type(inbredsetid): """ cursor.execute(sql, (inbredsetid)) return cursor.fetchall() - - -print get_type()
\ No newline at end of file diff --git a/wqflask/maintenance/dataset/probesets/probesets.py b/wqflask/maintenance/dataset/probesets/probesets.py new file mode 100644 index 00000000..7fa65786 --- /dev/null +++ b/wqflask/maintenance/dataset/probesets/probesets.py @@ -0,0 +1,45 @@ +import sys +sys.path.append('.') +sys.path.append('..') + +from utilities import db + +def fetch_probesetxref(probesetfreezeid): + cursor = db.get_cursor() + sql = """ + SELECT ProbeSetXRef.`ProbeSetId`, ProbeSetXRef.`DataId` + FROM ProbeSetXRef + WHERE ProbeSetXRef.`ProbeSetFreezeId`=%s + """ + cursor.execute(sql, (probesetfreezeid)) + return cursor.fetchall() + +def fetch_probeset(probesetid): + cursor = db.get_cursor() + sql = """ + SELECT * + FROM ProbeSet + WHERE ProbeSet.`Id`=%s + """ + cursor.execute(sql, (probesetid)) + return cursor.fetchone() + +def fetch_probesetdata(probesetdataid): + cursor = db.get_cursor() + sql = """ + SELECT Strain.`Id`, Strain.`Name`, ProbeSetData.`value` + FROM ProbeSetData, Strain + WHERE ProbeSetData.`Id`=%s + AND ProbeSetData.`StrainId`=Strain.`Id`; + """ + cursor.execute(sql, (probesetdataid)) + return cursor.fetchall() + +results = fetch_probesetxref(112) +for row in results: + print row + probesetid = row[0] + probesetdataid = row[1] + print fetch_probeset(probesetid) + print fetch_probesetdata(probesetdataid) + break
\ No newline at end of file |