diff options
author | Frederick Muriuki Muriithi | 2025-06-09 14:16:53 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-06-09 14:16:53 -0500 |
commit | bffce9763f044f806bd396d799304f1ca2acf655 (patch) | |
tree | 52f1348efc6da9f5f48d54c463642519ec13e1be | |
parent | b2fb5efe29ca0f7d319346305517445e99c9396b (diff) | |
download | gn-uploader-bffce9763f044f806bd396d799304f1ca2acf655.tar.gz |
Compute request data for …/data/link/phenotypes endpoint.
-rw-r--r-- | scripts/load_phenotypes_to_db.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py index 116605f..2b024c1 100644 --- a/scripts/load_phenotypes_to_db.py +++ b/scripts/load_phenotypes_to_db.py @@ -258,14 +258,27 @@ def update_auth(authserver, token, species, population, dataset, xrefdata): headers=headers ) - def __link_data__(user, group): + def __link_data__(user): logger.debug("… linking uploaded data to user's group") return mrequests.post( authserveruri("/auth/data/link/phenotype"), headers=headers, - data={ + json={ + "species_name": species["Name"], "group_id": user["group"]["group_id"], - "traits": []# TODO: process these here + "selected": [ + { + "SpeciesId": species["SpeciesId"], + "InbredSetId": population["Id"], + "PublishFreezeId": dataset["Id"], + "dataset_name": dataset["Name"], + "dataset_fullname": dataset["FullName"], + "dataset_shortname": dataset["ShortName"], + "PublishXRefId": item["xref_id"] + } + for item in xrefdata + ], + "using-raw-ids": "on" }).then(lambda ld_results: (user, ld_results)) def __fetch_phenotype_category_details__(user, linkeddata): |