diff options
Diffstat (limited to 'scripts')
-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): |