aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/webqtlTrait.py
diff options
context:
space:
mode:
authorZachary Sloan2012-12-04 16:19:46 -0600
committerZachary Sloan2012-12-04 16:19:46 -0600
commit0e17939e123ec80c4da3f665004b08347aa9480b (patch)
tree5b5f9c92a06b44ca98a8b17fec4bb774c157e0cd /wqflask/base/webqtlTrait.py
parent21253f4424fbcdf76212a55011e657ebeb87da82 (diff)
downloadgenenetwork2-0e17939e123ec80c4da3f665004b08347aa9480b.tar.gz
Began changing references to cursor/db_conn to use sqlalchemy
Wrote function for phenotype author searches
Diffstat (limited to 'wqflask/base/webqtlTrait.py')
-rwxr-xr-xwqflask/base/webqtlTrait.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/wqflask/base/webqtlTrait.py b/wqflask/base/webqtlTrait.py
index 1dceba08..9763e441 100755
--- a/wqflask/base/webqtlTrait.py
+++ b/wqflask/base/webqtlTrait.py
@@ -30,9 +30,9 @@ class webqtlTrait:
self.cellid = kw.get('cellid', None)
self.identification = kw.get('identification', 'un-named trait')
self.group = kw.get('group', None)
- self.haveinfo = kw.get(haveinfo, False)
- self.sequence = kw.get(sequence, None) # Blat sequence, available for ProbeSet
- self.data = kw.get(data, {})
+ self.haveinfo = kw.get('haveinfo', False)
+ self.sequence = kw.get('sequence', None) # Blat sequence, available for ProbeSet
+ self.data = kw.get('data', {})
if kw.get('fullname'):
name2 = value.split("::")
@@ -381,7 +381,7 @@ class webqtlTrait:
# return self.__dict__.items()
def retrieveInfo(self, QTL = None):
- assert self.dataset and self.cursor
+ assert self.dataset
if self.dataset.type == 'Publish':
#self.dataset.DisField = ['Name','PubMed_ID','Phenotype','Abbreviation','Authors','Title',\
# 'Abstract', 'Journal','Volume','Pages','Month','Year','Sequence',\
@@ -434,10 +434,11 @@ class webqtlTrait:
Geno.Name = '%s'
""" % (display_fields_string, self.dataset.name, self.name)
else: #Temp type
- query = 'SELECT %s FROM %s WHERE Name = "%s"' % \
- (string.join(self.dataset.display_fields,','), self.dataset.type, self.name)
-
+ traitInfo = g.db.execute("""SELECT %s FROM %s WHERE Name = '%s'
+ """, (string.join(self.dataset.display_fields,','),
+ self.dataset.type, self.name)).fetchone()
+
self.cursor.execute(query)
traitInfo = self.cursor.fetchone()
if traitInfo: