aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-09-30 14:25:26 +0300
committerFrederick Muriuki Muriithi2022-09-30 14:25:26 +0300
commita9426eaf6e2f4180b8408bd7df06b0435330df12 (patch)
tree862066892c2c5a356f0176f894063535d3d83afe /wqflask
parent6f1a66b32cca2ac6e3178fde35ff45edace6522d (diff)
downloadgenenetwork2-a9426eaf6e2f4180b8408bd7df06b0435330df12.tar.gz
Remove unused table and simplify query
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/correlation/pre_computes.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/wqflask/wqflask/correlation/pre_computes.py b/wqflask/wqflask/correlation/pre_computes.py
index afcea88f..20fe84e3 100644
--- a/wqflask/wqflask/correlation/pre_computes.py
+++ b/wqflask/wqflask/correlation/pre_computes.py
@@ -238,19 +238,13 @@ def write_db_to_textfile(db_name, conn, text_dir=TMPDIR):
writer.writerows(data.values())
with conn.cursor() as cursor:
cursor.execute(
- "SELECT ProbeSet.Name,Strain.Name, ProbeSetData.value "
- "FROM (ProbeSetData, ProbeSetFreeze, Strain, ProbeSet, "
- "ProbeSetXRef) LEFT JOIN ProbeSetSE ON "
- "(ProbeSetSE.DataId = ProbeSetData.Id AND "
- "ProbeSetSE.StrainId = ProbeSetData.StrainId) "
- "LEFT JOIN NStrain ON "
- "(NStrain.DataId = ProbeSetData.Id AND "
- "NStrain.StrainId = ProbeSetData.StrainId) "
- "WHERE ProbeSetXRef.ProbeSetId = ProbeSet.Id "
- "AND ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id "
- "AND ProbeSetFreeze.Name = %s AND "
- "ProbeSetXRef.DataId = ProbeSetData.Id "
- "AND ProbeSetData.StrainId = Strain.Id "
+ "SELECT ProbeSet.Name, Strain.Name, ProbeSetData.value "
+ "FROM Strain LEFT JOIN ProbeSetData "
+ "ON Strain.Id = ProbeSetData.StrainId "
+ "LEFT JOIN ProbeSetXRef ON ProbeSetData.Id = ProbeSetXRef.DataId "
+ "LEFT JOIN ProbeSet ON ProbeSetXRef.ProbeSetId = ProbeSet.Id "
+ "WHERE ProbeSetXRef.ProbeSetFreezeId IN "
+ "(SELECT Id FROM ProbeSetFreeze WHERE Name = %s) "
"ORDER BY Strain.Name",
(db_name,))
results = cursor.fetchall()