diff options
author | Frederick Muriuki Muriithi | 2025-04-14 16:10:49 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-04-14 16:10:49 -0500 |
commit | 14aed51e4aab04c1c53549ee9f1ce5fc20d6b11e (patch) | |
tree | a493c4b9783ba4eb922c378de0533c9b48500e73 /scripts | |
parent | fa3dd73aed2d238957cc449a9e3c7b1ee1d86352 (diff) | |
download | gn-uploader-14aed51e4aab04c1c53549ee9f1ce5fc20d6b11e.tar.gz |
Convert values to float where present.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/phenotypes_bulk_edit.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/phenotypes_bulk_edit.py b/scripts/phenotypes_bulk_edit.py index bbce60d..0b4fec5 100644 --- a/scripts/phenotypes_bulk_edit.py +++ b/scripts/phenotypes_bulk_edit.py @@ -148,6 +148,12 @@ def read_file(filepath: Path) -> Iterator[str]: ((None if item.strip() == "" else item.strip()) for item in fields))) _pheno, _xref = _dict.pop("UniqueIdentifier").split("::") + _dict = { + key: ((float(val) if bool(val) else val) + if key not in BULK_EDIT_COMMON_FIELDNAMES + else val) + for key, val in _dict.items() + } _dict["phenotype_id"] = int(_pheno.split(":")[1]) _dict["xref_id"] = int(_xref.split(":")[1]) if _dict["PubMed_ID"] is not None: |