aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/data_set.py
diff options
context:
space:
mode:
authorAlexander Kabui2021-05-10 08:24:42 +0300
committerAlexander Kabui2021-05-10 08:24:42 +0300
commit27538980f93c1d72b0b2d76151312f3fbce4c9a5 (patch)
tree39ca6113713f93ea4ec345d3bd19ee2c5a479258 /wqflask/base/data_set.py
parent049a438741d19b1cf6c8c290ec01343b51690b30 (diff)
downloadgenenetwork2-27538980f93c1d72b0b2d76151312f3fbce4c9a5.tar.gz
add previous endpoint for correlation
Diffstat (limited to 'wqflask/base/data_set.py')
-rw-r--r--wqflask/base/data_set.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 468c4da0..d0f5e6f2 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -655,42 +655,7 @@ class DataSet(object):
"Dataset {} is not yet available in GeneNetwork.".format(self.name))
pass
- def fetch_probe_trait_data(self, sample_list=None):
- if sample_list:
- self.samplelist = sample_list
- else:
- self.samplelist = self.group.samplelist
-
- if self.group.parlist != None and self.group.f1list != None:
- if (self.group.parlist + self.group.f1list) in self.samplelist:
- self.samplelist += self.group.parlist + self.group.f1list
-
- query = """
- SELECT Strain.Name, Strain.Id FROM Strain, Species
- WHERE Strain.Name IN {}
- and Strain.SpeciesId=Species.Id
- and Species.name = '{}'
- """.format(create_in_clause(self.samplelist), *mescape(self.group.species))
- logger.sql(query)
- results = dict(g.db.execute(query).fetchall())
- sample_ids = [results[item] for item in self.samplelist]
-
- query = """SELECT * from ProbeSetData WHERE Id in ( SELECT ProbeSetXRef.DataId FROM (ProbeSet, ProbeSetXRef, ProbeSetFreeze) WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id and ProbeSetFreeze.Name = 'HC_M2_0606_P' and ProbeSet.Id = ProbeSetXRef.ProbeSetId order by ProbeSet.Id ) and StrainId in ({})""".format(
- ",".join(str(sample_id) for sample_id in sample_ids))
- results = g.db.execute(query).fetchall()
-
- # with conn:
- # cursor = conn.cursor()
- # cursor.execute(query)
- # results = cursor.fetchall()
- trait_data = {}
- for trait_id, StrainId, value in results:
- if trait_id in trait_data:
- trait_data[trait_id].append(value)
- else:
- trait_data[trait_id] = [value]
- self.trait_data = trait_data
def get_trait_data(self, sample_list=None):
if sample_list:
@@ -711,7 +676,6 @@ class DataSet(object):
logger.sql(query)
results = dict(g.db.execute(query).fetchall())
sample_ids = [results[item] for item in self.samplelist]
- print("the number of sample ids are", len(sample_ids))
# MySQL limits the number of tables that can be used in a join to 61,
# so we break the sample ids into smaller chunks
@@ -762,7 +726,6 @@ class DataSet(object):
trait_sample_data.append(results)
trait_count = len(trait_sample_data[0])
- print("the trait count is >>>", trait_count)
self.trait_data = collections.defaultdict(list)
# put all of the separate data together into a dictionary where the keys are