Skip to content

Commit

Permalink
[pred_mod] fix uns output in process_datasets (#376)
Browse files Browse the repository at this point in the history
* Update get_dataset_info to include common_dataset_id

* refactor copy of `.uns`

* Update src/common/process_task_results/get_dataset_info/script.R

Co-authored-by: Robrecht Cannoodt <[email protected]>

---------

Co-authored-by: Robrecht Cannoodt <[email protected]>
  • Loading branch information
KaiWaldrant and rcannood authored Feb 15, 2024
1 parent e2cc44f commit 8d447db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/common/process_task_results/get_dataset_info/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ outputs <- map(datasets, function(dataset) {
"data_url" = dataset$dataset_url %||% NA_character_
)

if (!is.null(dataset[["common_dataset_id"]])) {
out[["common_dataset_id"]] <- dataset[["common_dataset_id"]]
}

# show warning when certain data is missing and return null?
for (n in names(out)) {
if (is.null(out[[n]])) {
Expand Down
3 changes: 2 additions & 1 deletion src/tasks/predict_modality/process_dataset/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ ad2_mod <- unique(ad2$var[["feature_types"]])

# determine new uns
uns_vars <- c("dataset_id", "dataset_name", "dataset_url", "dataset_reference", "dataset_summary", "dataset_description", "dataset_organism", "normalization_id")
ad1_uns <- ad2_uns <- ad1$uns[uns_vars]
ad1_uns <- ad1$uns[uns_vars]
ad2_uns <- ad2$uns[uns_vars]
ad1_uns$modality <- ad1_mod
ad2_uns$modality <- ad2_mod

Expand Down

0 comments on commit 8d447db

Please sign in to comment.