diff options
author | zsloan | 2023-05-01 19:51:25 +0000 |
---|---|---|
committer | zsloan | 2023-05-22 17:23:08 +0000 |
commit | 421a7cec8e125e54a01a0cd71e0bef64ee8c3462 (patch) | |
tree | 125cc2ae40f30beaad052029800f88bbabc478c8 /gn3/db/sample_data.py | |
parent | 3a0a7c1838beb528915e699292c6d3c01ef4cdc4 (diff) | |
download | genenetwork3-421a7cec8e125e54a01a0cd71e0bef64ee8c3462.tar.gz |
Fix get_trait_sample_data function
Diffstat (limited to 'gn3/db/sample_data.py')
-rw-r--r-- | gn3/db/sample_data.py | 24 |
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 |