aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
authorzsloan2023-05-01 19:51:25 +0000
committerzsloan2023-05-22 17:23:08 +0000
commit421a7cec8e125e54a01a0cd71e0bef64ee8c3462 (patch)
tree125cc2ae40f30beaad052029800f88bbabc478c8 /gn3/db
parent3a0a7c1838beb528915e699292c6d3c01ef4cdc4 (diff)
downloadgenenetwork3-421a7cec8e125e54a01a0cd71e0bef64ee8c3462.tar.gz
Fix get_trait_sample_data function
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/sample_data.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/gn3/db/sample_data.py b/gn3/db/sample_data.py
index d8232cb..29a35d6 100644
--- a/gn3/db/sample_data.py
+++ b/gn3/db/sample_data.py
@@ -68,20 +68,20 @@ FROM PublishFreeze pf JOIN PublishXRef px ON px.InbredSetId = pf.InbredSetId
JOIN PublishData pd ON pd.Id = px.DataId JOIN Strain st ON pd.StrainId = st.Id
LEFT JOIN PublishSE ps ON ps.DataId = pd.Id AND ps.StrainId = pd.StrainId
LEFT JOIN NStrain ns ON ns.DataId = pd.Id AND ns.StrainId = pd.StrainId
- AND px.Id = %s AND px.PhenotypeId = %s
+WHERE px.Id = %s AND px.PhenotypeId = %s
ORDER BY st.Name""", (trait_name, phenotype_id))
- sample_data = {}
- for data in cursor.fetchall():
- this_data = {}
- sample, value, error, n_cases = data
- sample_data[sample] = {
- 'value': value,
- 'error': error,
- 'n_cases:': n_cases
- }
-
- return sample_data
+ sample_data = {}
+ for data in cursor.fetchall():
+ this_data = {}
+ sample, value, error, n_cases = data
+ sample_data[sample] = {
+ 'value': value,
+ 'error': error,
+ 'n_cases:': n_cases
+ }
+
+ return sample_data
def get_trait_csv_sample_data(
conn: Any, trait_name: int, phenotype_id: int