aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
authorzsloan2023-08-17 19:53:54 +0000
committerzsloan2023-08-17 14:54:42 -0500
commit684d9e37381120f171aff5f9f9a58ceaefa1901e (patch)
tree43dbf76cc7769d5d959f44d0fb43d349d6deabce /gn3/db
parenta74f8e4cd312fe68125868776b1cc21182ae4718 (diff)
downloadgenenetwork3-684d9e37381120f171aff5f9f9a58ceaefa1901e.tar.gz
Fix query for fetching DataId when inserting ProbeSet data
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/sample_data.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/gn3/db/sample_data.py b/gn3/db/sample_data.py
index 4cf1058..1f9d519 100644
--- a/gn3/db/sample_data.py
+++ b/gn3/db/sample_data.py
@@ -192,11 +192,14 @@ WHERE ps.Id = %s AND psf.Name= %s AND st.Name = %s""", (probeset_id, dataset_nam
strain_id, probesetdata_id, inbredset_id = _result
if not all([strain_id, probesetdata_id, inbredset_id]):
# Applies for data to be inserted:
- cursor.execute(
- "SELECT DataId, InbredSetId FROM ProbeSetXRef "
- "WHERE Id = %s",
- (probesetxref_id),
- )
+ cursor.execute("""
+SELECT psx.DataId, pf.InbredSetId
+FROM ProbeFreeze pf
+ JOIN ProbeSetFreeze psf ON psf.ProbeFreezeId = pf.Id
+ JOIN ProbeSetXRef psx ON psx.ProbeSetFreezeId = psf.Id
+WHERE psx.ProbeSetId = %s AND
+ psf.Name = %s""", (probeset_id, dataset_name))
+
probesetdata_id, inbredset_id = cursor.fetchone()
cursor.execute(
"SELECT Id FROM Strain WHERE Name = %s", (strain_name,)