Skip to content

Commit

Permalink
Merge pull request #1 from UW-GAC/feature/keep-all-pheno-harmonized-rows
Browse files Browse the repository at this point in the history
Keep all rows in the phenotype harmonized table
  • Loading branch information
amstilp authored May 8, 2024
2 parents fe2efd4 + 6aeb7fb commit 929707b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion primed_phenotype_inventory.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ task write_primed_phenotype_inventory_table {
>>>

runtime {
docker: "uwgac/primed-inventory-workflows:0.1.0"
docker: "uwgac/primed-inventory-workflows:0.1.1"
}
}
18 changes: 4 additions & 14 deletions write_primed_phenotype_inventory_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ for (i in seq_along(workspaces$workspace)) {

tables <- avtables(namespace=workspace_namespace, name=workspace_name)
if (input_table_name %in% tables$table) {
table <- avtable(input_table_name, namespace=workspace_namespace, name=workspace_name)
x <- table %>%
# phenotype_harmonized_id is needed to make the table unique.
select(phenotype_harmonized_id, table=domain, n_subjects, n_rows, file_path)
x <- avtable(input_table_name, namespace=workspace_namespace, name=workspace_name)
}
else {
x = tibble()
Expand All @@ -73,18 +70,11 @@ id_column_name = quo_name(paste0(output_table_name, "_id"))
results <- results %>%
# We separated workspace into namespace and name, so we don't need it anymore.
select(-workspace) %>%
select(
rename(
# Set the id column appropriately, using the output table name.
!!id_column_name := phenotype_harmonized_id,
studies,
workspace_namespace,
workspace_name,
table,
n_rows,
n_subjects,
file_path,
everything(),
!!id_column_name := phenotype_harmonized_id
)
print(results)

# Delete the table before writing the new data, if it already exists.
tables <- avtables(namespace=output_workspace_namespace, name=output_workspace_name)
Expand Down

0 comments on commit 929707b

Please sign in to comment.