Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Feb 2, 2024
2 parents de27d57 + 9e87b12 commit 6d8d51d
Show file tree
Hide file tree
Showing 153 changed files with 608 additions and 309 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: CohortMethod
Type: Package
Title: New-User Cohort Method with Large Scale Propensity and Outcome Models
Version: 5.2.0
Date: 2023-12-21
Version: 5.2.1
Date: 2024-02-01
Authors@R: c(
person("Martijn", "Schuemie", , "schuemie@ohdsi.org", role = c("aut", "cre")),
person("Marc", "Suchard", role = c("aut")),
Expand Down Expand Up @@ -70,6 +70,6 @@ Remotes:
ohdsi/ShinyAppBuilder
LinkingTo: Rcpp
NeedsCompilation: yes
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
14 changes: 14 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
CohortMethod 5.2.1
==================

Changes:

1. Ask to delete files in output folder when calling `runCmAnalyses()` with different analyses settings than those used to create the files. Also cleaning the cache.

Bugfixes:

1. Fixed bug in parsing covariate filter settings for balance.

2. Updated vignettes to use latest `Capr` functions.


CohortMethod 5.2.0
==================

Expand Down
2 changes: 1 addition & 1 deletion R/Analyses.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file Analyses.R
#
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/AttritionDiagram.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file AttritionDiagram.R
#
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
4 changes: 2 additions & 2 deletions R/Balance.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down Expand Up @@ -36,7 +36,7 @@ filterCovariates <- function(covariates, covariateRef, covariateFilter) {
covariateIds2 <- covariateFilter %>%
filter(!is.na(.data$covariateIds)) %>%
pull(.data$covariateIds) %>%
strsplit(",") %>%
strsplit(",|;") %>%
unlist() %>%
as.numeric()
covariates %>%
Expand Down
2 changes: 1 addition & 1 deletion R/CohortMethod.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file CohortMethod.R
#
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/CohortMethodData.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/DataLoadingSaving.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/Export.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/HelperFunctions.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file HelperFunctions.R
#
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/KaplanMeier.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file KaplanMeier.R
#
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/OutcomeModels.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/Power.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file Power.R
#
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/PsFunctions.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/ResultsDataModel.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
23 changes: 18 additions & 5 deletions R/RunAnalyses.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down Expand Up @@ -259,10 +259,26 @@ runCmAnalyses <- function(connectionDetails,
stop("Duplicate analysis IDs are not allowed")
}
outputFolder <- normalizePath(outputFolder, mustWork = FALSE)
cmAnalysisListFile <- file.path(outputFolder, "cmAnalysisList.rds")
if (file.exists(cmAnalysisListFile)) {
oldCmAnalysisList <- readRDS(cmAnalysisListFile)
if (!isTRUE(all.equal(oldCmAnalysisList, cmAnalysisList))) {
rm(list=ls(envir = cache), envir = cache)
message(sprintf("Output files already exist in '%s', but the analysis settings have changed.", outputFolder))
response <- utils::askYesNo("Do you want to delete the old files before proceeding?")
if (is.na(response)) {
# Cancel:
return()
} else if (response == TRUE) {
unlink(outputFolder, recursive = TRUE)
}
}
}
if (!file.exists(outputFolder)) {
dir.create(outputFolder)
}

saveRDS(cmAnalysisList, cmAnalysisListFile)
saveRDS(targetComparatorOutcomesList, file.path(outputFolder, "targetComparatorOutcomesList.rds"))
referenceTable <- createReferenceTable(
cmAnalysisList = cmAnalysisList,
targetComparatorOutcomesList = targetComparatorOutcomesList,
Expand All @@ -275,9 +291,6 @@ runCmAnalyses <- function(connectionDetails,
select(-"includedCovariateConceptIds", "excludedCovariateConceptIds") %>%
saveRDS(file.path(outputFolder, "outcomeModelReference.rds"))

saveRDS(cmAnalysisList, file.path(outputFolder, "cmAnalysisList.rds"))
saveRDS(targetComparatorOutcomesList, file.path(outputFolder, "targetComparatorOutcomesList.rds"))

# Create cohortMethodData objects -----------------------------
subset <- referenceTable[!duplicated(referenceTable$cohortMethodDataFile), ]
subset <- subset[subset$cohortMethodDataFile != "", ]
Expand Down
2 changes: 1 addition & 1 deletion R/Simulation.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/StudyPopulation.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/Table1.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file Table1.R
#
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion R/Viewer.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Observational Health Data Sciences and Informatics
# Copyright 2024 Observational Health Data Sciences and Informatics
#
# This file is part of CohortMethod
#
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

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

Loading

0 comments on commit 6d8d51d

Please sign in to comment.