From 712bb893ba9f3a26c21ce3bafbc79d2953038030 Mon Sep 17 00:00:00 2001 From: Sage Wright Date: Tue, 19 Sep 2023 17:20:54 +0000 Subject: [PATCH] fix private_id column bug --- tasks/utilities/task_czgenepi_wrangling.wdl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/utilities/task_czgenepi_wrangling.wdl b/tasks/utilities/task_czgenepi_wrangling.wdl index 3c6c338a3..97081458a 100644 --- a/tasks/utilities/task_czgenepi_wrangling.wdl +++ b/tasks/utilities/task_czgenepi_wrangling.wdl @@ -54,13 +54,14 @@ task czgenepi_wrangling { table = table.fillna("") # extract metadata to new table - print("DEBUG: copying required metadata columns") + print("DEBUG: copying require metadata columns") metadata = table[REQUIRED_COLUMNS].copy() print("DEBUG: copying optional metadata columns") for column in OPTIONAL_COLUMNS: if column in table.columns: metadata[column] = table[column] + else: if column == "sample_is_private": # by default, all samples will be set as private @@ -79,6 +80,8 @@ task czgenepi_wrangling { print("DEBUG: checking if private_id column was set") if "~{private_id_column_name}" == "~{terra_table_name}_id": + print("DEBUG: removing duplicated column") + metadata = metadata.loc[:, ~metadata.columns.duplicated()].copy() metadata["Private ID"] = metadata.loc[:, "~{private_id_column_name}"] else: metadata.rename(columns={"~{private_id_column_name}": "Private ID"}, inplace=True)