diff options
author | BonfaceKilz | 2022-03-02 15:54:48 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-03-12 15:33:01 +0300 |
commit | fb0ca34547f2b804154e4c0d554cd383c96cce42 (patch) | |
tree | cc7ef65f24a1fa61927f6631db32151648f2b99a | |
parent | d1adfc7f679c0ab09b41d6de67918aba82035253 (diff) | |
download | genenetwork2-fb0ca34547f2b804154e4c0d554cd383c96cce42.tar.gz |
Use updated `delete_sample_data` from gn3
-rw-r--r-- | wqflask/wqflask/metadata_edits.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index 24cbd3d1..c9af0467 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -544,18 +544,19 @@ def approve_data(resource_id:str, file_name: str): "changes could be applied."), "warning") n_deletions = 0 - for deletion in (deletions := [d for d in sample_data.get("Deletions")]): - strain_name, _, _, _ = deletion.split(",") - __deletions, _, _ = delete_sample_data( + for data in [d for d in sample_data.get("Deletions")]: + __deletions = delete_sample_data( conn=conn, trait_name=sample_data.get("trait_name"), - strain_name=strain_name, + data=data, + csv_header=sample_data.get("Columns", + "Strain Name,Value,SE,Count"), phenotype_id=int(sample_data.get("phenotype_id"))) if __deletions: n_deletions += 1 # Remove any data that already exists from sample_data deletes else: - sample_data.get("Deletions").remove(deletion) + sample_data.get("Deletions").remove(data) n_insertions = 0 for data in [d for d in sample_data.get("Additions")]: |