Skip to content

Commit

Permalink
Upload intermediate summaries (output concepts) files to internal Syn…
Browse files Browse the repository at this point in the history
…apse location for use in validation of staging i2b2 summaries data
  • Loading branch information
pranavanba committed Oct 3, 2024
1 parent 5d86d2e commit 46594b9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ staging:
s3basekey: main/archive/2024-06-13/
selectedVarsFileID: syn53503994
outputConceptsDir: ./temp-output-concepts
tempOutputConceptSynID: syn53822708

prod:
inherits: staging
Expand Down
24 changes: 24 additions & 0 deletions scripts/write-output/upload-intermediate-summaries-files.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generate a TSV manifest file of intermediate summaries files (intermediate output concepts files)
synapserutils::generate_sync_manifest(
directory_path = outputConceptsDir,
parent_id = tempOutputConceptSynID,
manifest_path = "temp-output-concepts-manifest.tsv"
)

# Exclude the final output_concepts.csv file from the manifest and write the
# modified manifest file to a CSV file
read.delim("temp-output-concepts-manifest.tsv") %>%
dplyr::filter(!grepl("output_concepts.csv", path)) %>%
write.csv(file = "temp-output-concepts-manifest.csv", row.names = FALSE, quote = FALSE)

login <- synapser::synLogin()

# Store each file listed in the CSV manifest file at its specified parent Synapse ID
synapserutils::syncToSynapse(manifestFile = "temp-output-concepts-manifest.csv")

# synclient <- reticulate::import("synapseclient")
# syn_temp <- synclient$Synapse()
# syn <- syn_temp$login()
#
# synutils <- reticulate::import("synapseutils")
# synutils$syncToSynapse(syn = syn, manifestFile = "temp-output-concepts-manifest.csv")

0 comments on commit 46594b9

Please sign in to comment.