Skip to content

Commit

Permalink
Specify recoverutils package namespace for function calls from this p…
Browse files Browse the repository at this point in the history
…ackage
  • Loading branch information
pranavanba committed Jul 11, 2024
1 parent 24df096 commit 6f68585
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions scripts/egress/egress.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ cat(glue::glue("Output concepts stored at {synFolderID}"), "\n\n")

file_name <- "concepts_map.csv"
write.csv(concept_map, file = file_name, row.names = F)
store_in_syn(synFolderID, file_name, used_param = ontologyFileID)
recoverutils::store_in_syn(synFolderID, file_name, used_param = ontologyFileID)
cat(glue::glue("The input concept map used was stored at {synFolderID} as '{file_name}'"), "\n\n")

file_name <- "selected_vars.csv"
write.csv(selected_vars, file = file_name, row.names = F)
store_in_syn(synFolderID, file_name, used_param = selectedVarsFileID)
recoverutils::store_in_syn(synFolderID, file_name, used_param = selectedVarsFileID)
cat(glue::glue("The input variable list used was stored at {synFolderID} as '{file_name}'"), "\n\n")

rm(latest_commit,
Expand Down
6 changes: 3 additions & 3 deletions scripts/fetch-data/fetch_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ synLogin()

# Get input files from synapse
concept_map <-
syn_file_to_df(ontologyFileID, "CONCEPT_CD") %>%
recoverutils::syn_file_to_df(ontologyFileID, "CONCEPT_CD") %>%
filter(CONCEPT_CD!="<null>")

selected_vars <-
syn_file_to_df(selectedVarsFileID) %>%
recoverutils::syn_file_to_df(selectedVarsFileID) %>%
mutate(Lower_Bound = suppressWarnings(as.numeric(Lower_Bound)),
Upper_Bound = suppressWarnings(as.numeric(Upper_Bound)))

Expand Down Expand Up @@ -49,7 +49,7 @@ system(sync_cmd)
rm(sync_cmd)

# For use in process-data steps
concept_replacements_reversed <- vec_reverse(concept_replacements)
concept_replacements_reversed <- recoverutils::vec_reverse(concept_replacements)

if (!dir.exists(outputConceptsDir)) {
dir.create(outputConceptsDir)
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-data/fitbitactivitylogs.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cat("recoverutils::stat_summarize() completed.\n")

# Add i2b2 columns from concept map (ontology file) and clean the output
output_concepts <-
process_df(df_summarized, concept_map, concept_replacements_reversed, concept_map_concepts = "CONCEPT_CD", concept_map_units = "UNITS_CD") %>%
recoverutils::process_df(df_summarized, concept_map, concept_replacements_reversed, concept_map_concepts = "CONCEPT_CD", concept_map_units = "UNITS_CD") %>%
dplyr::mutate(nval_num = signif(nval_num, 9)) %>%
dplyr::arrange(concept) %>%
dplyr::mutate(dplyr::across(.cols = dplyr::everything(), .fns = as.character)) %>%
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-data/fitbitdailydata.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cat("recoverutils::stat_summarize() completed.\n")

# Add i2b2 columns from concept map (ontology file) and clean the output
output_concepts <-
process_df(df_summarized,
recoverutils::process_df(df_summarized,
concept_map,
concept_replacements_reversed,
concept_map_concepts = "CONCEPT_CD",
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-data/fitbitintradaycombined.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ cat("recoverutils::stat_summarize() completed.\n")

# Add i2b2 columns from concept map (ontology file) and clean the output
output_concepts <-
process_df(df_summarized, concept_map, concept_replacements_reversed, concept_map_concepts = "CONCEPT_CD", concept_map_units = "UNITS_CD") %>%
recoverutils::process_df(df_summarized, concept_map, concept_replacements_reversed, concept_map_concepts = "CONCEPT_CD", concept_map_units = "UNITS_CD") %>%
dplyr::mutate(nval_num = signif(nval_num, 9)) %>%
dplyr::arrange(concept) %>%
dplyr::mutate(dplyr::across(.cols = dplyr::everything(), .fns = as.character)) %>%
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-data/fitbitsleeplogs.R
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ cat("sleeplogs_stat_summarize() completed.\n")

# Add i2b2 columns from concept map (ontology file) and clean the output
output_concepts <-
process_df(final_df_summarized, concept_map, concept_replacements_reversed, concept_map_concepts = "CONCEPT_CD", concept_map_units = "UNITS_CD") %>%
recoverutils::process_df(final_df_summarized, concept_map, concept_replacements_reversed, concept_map_concepts = "CONCEPT_CD", concept_map_units = "UNITS_CD") %>%
dplyr::mutate(nval_num = signif(nval_num, 9)) %>%
dplyr::arrange(concept) %>%
dplyr::mutate(dplyr::across(.cols = dplyr::everything(), .fns = as.character)) %>%
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-data/healthkitv2activitysummaries.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ df_summarized <-
cat("recoverutils::stat_summarize() completed.\n")

output_concepts <-
process_df(df_summarized, concept_map, concept_replacements_reversed, concept_map_concepts = "CONCEPT_CD", concept_map_units = "UNITS_CD") %>%
recoverutils::process_df(df_summarized, concept_map, concept_replacements_reversed, concept_map_concepts = "CONCEPT_CD", concept_map_units = "UNITS_CD") %>%
dplyr::mutate(nval_num = signif(nval_num, 9)) %>%
dplyr::arrange(concept) %>%
dplyr::mutate(dplyr::across(.cols = dplyr::everything(), .fns = as.character)) %>%
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-data/healthkitv2samples.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ tmp_concept_replacements <- c("respiratoryrate" = "breathingrate",

# Add i2b2 columns from concept map (ontology file) and clean the output
output_concepts <-
process_df(df_summarized,
recoverutils::process_df(df_summarized,
concept_map,
concept_replacements_reversed = tmp_concept_replacements,
concept_map_concepts = "CONCEPT_CD",
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-data/healthkitv2statistics.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tmp_concept_replacements <- c("dailysteps" = "steps")

# Add i2b2 columns from concept map (ontology file) and clean the output
output_concepts <-
process_df(df_summarized,
recoverutils::process_df(df_summarized,
concept_map,
concept_replacements_reversed = tmp_concept_replacements,
concept_map_concepts = "CONCEPT_CD",
Expand Down

0 comments on commit 6f68585

Please sign in to comment.