aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorLei Yan2013-05-23 21:19:00 +0000
committerLei Yan2013-05-23 21:19:00 +0000
commit953b41486b035fbe786c7d2675f7b6cf898c12da (patch)
tree1a314a5a3d65e7684a7b7abb200f43e6139e44a5 /wqflask/base
parente31d163325d0d417bf266d1c3d9e52b6ff00f83b (diff)
downloadgenenetwork2-953b41486b035fbe786c7d2675f7b6cf898c12da.tar.gz
Changed the way the query that gets sample ids is generated
Diffstat (limited to 'wqflask/base')
-rwxr-xr-xwqflask/base/data_set.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 89bbf03d..b2836480 100755
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -625,33 +625,24 @@ class MrnaAssayDataSet(DataSet):
return trait_data
def get_trait_data(self):
- import pdb
- pdb.set_trace()
- #samplelist = []
- #samplelist += self.group.samplelist
- #samplelist += self.group.parlist
- #samplelist += self.group.f1list
- #self.samplelist = samplelist
-
self.samplelist = self.group.samplelist + self.group.parlist + self.group.f1list
-
sample_ids = []
-
where_clause = ""
- for sample in self.samplelist:
- if len(where_clause):
- where_clause += " or "
- where_clause += """'{}'""".format(*mescape(sample))
+ #for sample in self.samplelist:
+ # if len(where_clause):
+ # where_clause += " or "
+ # where_clause += "Strain.Name = '{}'".format(*mescape(sample))
query = """
SELECT Strain.Id, Strain.Name FROM Strain, Species
- WHERE Strain.Name = '{}'
+ WHERE ({})
and Strain.SpeciesId=Species.Id
and Species.name = '{}'
- """.format(*mescape(where_clause, self.group.species))
+ """.format(where_clause, *mescape(self.group.species))
+ print("raspberry query: ", query)
result = g.db.execute(query).fetchall()
- print("[blueberry] result is:", pf(result))
+ print("[blackberry] result is:", pf(result))
#sample_ids.append('%d' % this_id)
# MySQL limits the number of tables that can be used in a join to 61,