Skip to content

Commit

Permalink
Merge branch 'openclaims' of https://github.com/ohdsi-studies/LegendT2dm
Browse files Browse the repository at this point in the history
 into openclaims

sync with remote change
  • Loading branch information
fanbu1995 committed Nov 2, 2023
2 parents 8a765c3 + d34dcf9 commit ef3fd0c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 8 additions & 3 deletions R/prepareStagedExecution.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ prepareStagedExecution <- function(originalOutputFolder,
stageCounter = rep(1:stages, each = chunkSize)
exposureSummary$stage = stageCounter[1:nrow(exposureSummary)]

# file path to cohortCounts table
# file path to exposure cohortCounts table
exposureCohortCountsFile = file.path(indicationFolder, "cohortCounts.csv")

# file path to outcome cohortCounts table
outcomeFold <- file.path(originalOutputFolder, "outcome")
cohortCountsFile = file.path(outcomeFold, "cohortCounts.csv")

Expand All @@ -51,19 +54,21 @@ prepareStagedExecution <- function(originalOutputFolder,
dir.create(newOutputFolder)
}

# copy over cohortCounts table
# copy over outcome cohortCounts table
newOutcomeFolder = file.path(newOutputFolder, "outcome")
if(!dir.exists(newOutcomeFolder)){
dir.create(newOutcomeFolder)
}
file.copy(cohortCountsFile, newOutcomeFolder)

# write sliced pairedExposureSummary file
# copy over exposure cohortCounts table
newIndicationFolder = file.path(newOutputFolder, indicationId)
if(!dir.exists(newIndicationFolder)){
dir.create(newIndicationFolder)
}
file.copy(exposureCohortCountsFile, newIndicationFolder)

# write sliced pairedExposureSummary file
exposureSummarySlice <- exposureSummary %>% filter(stage == s) %>% select(-stage)
exposureSummarySliceFile = file.path(newIndicationFolder, "pairedExposureSummaryFilteredBySize.csv")
write.csv(exposureSummarySlice, exposureSummarySliceFile, row.names = FALSE)
Expand Down
1 change: 1 addition & 0 deletions extra/CodeToRunAllDrugs-OpenClaims.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ uploadPsAssessmentResults(cohort = indicationId,
##### OPEN CLAIMS staged execution code: ------

## create separate output folders for staged study execution:
## (try splitting to 10 stages first)
prepareStagedExecution(originalOutputFolder = outputFolder,
outputFolderHeader = outputFolder,
indicationId = "drug",
Expand Down
7 changes: 1 addition & 6 deletions man/LegendT2dm-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ef3fd0c

Please sign in to comment.