Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Schuemie authored and Schuemie committed Jan 21, 2022
2 parents 674c3d6 + f13c882 commit 0dbfe63
Show file tree
Hide file tree
Showing 64 changed files with 2,486 additions and 3,999 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
# RStudio files
.Rproj.user/
.Rproj.user

SignalInjectionTemp
97 changes: 50 additions & 47 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
Package: MethodEvaluation
Type: Package
Title: Package for Evaluation of Estimation Methods
Version: 2.1.0
Date: 2021-03-19
Authors@R: c(
person("Martijn", "Schuemie", , "[email protected]", role = c("aut", "cre"))
)
Maintainer: Martijn Schuemie <[email protected]>
Description: Resources for the evaluation of the
performance of methods that aim to estimate the magnitude (relative risk) of
the effect of a drug on an outcome. These resources include reference sets for
evaluating methods on real data, as well as functions for inserting simulated
effects in real data based on negative control drug-outcome pairs. Further
included are functions for the computation of the minimum detectable relative
risks and functions for computing performance statistics such as predictive
accuracy, error and bias.
License: Apache License 2.0
VignetteBuilder: knitr
URL: https://github.com/OHDSI/MethodEvaluation
BugReports: https://github.com/OHDSI/MethodEvaluation/issues
Depends:
R (>= 3.2.0),
DatabaseConnector (>= 3.0.0),
FeatureExtraction (>= 3.0.0),
Cyclops (>= 3.0.0)
Imports:
dplyr,
bit64,
readr,
purrr,
rlang,
SqlRender (>= 1.6.5),
pROC,
ggplot2,
ParallelLogger (>= 2.0.0),
methods,
EmpiricalCalibration
Suggests:
testthat,
DT,
shiny,
knitr
Remotes:
ohdsi/FeatureExtraction
RoxygenNote: 7.1.1
Encoding: UTF-8
Package: MethodEvaluation
Type: Package
Title: Package for Evaluation of Estimation Methods
Version: 2.2.0
Date: 2022-01-21
Authors@R: c(
person("Martijn", "Schuemie", , "[email protected]", role = c("aut", "cre"))
)
Maintainer: Martijn Schuemie <[email protected]>
Description: Resources for the evaluation of the
performance of methods that aim to estimate the magnitude (relative risk) of
the effect of a drug on an outcome. These resources include reference sets for
evaluating methods on real data, as well as functions for inserting simulated
effects in real data based on negative control drug-outcome pairs. Further
included are functions for the computation of the minimum detectable relative
risks and functions for computing performance statistics such as predictive
accuracy, error and bias.
License: Apache License 2.0
VignetteBuilder: knitr
URL: https://github.com/OHDSI/MethodEvaluation
BugReports: https://github.com/OHDSI/MethodEvaluation/issues
Depends:
R (>= 3.2.0),
DatabaseConnector (>= 4.0.2),
FeatureExtraction (>= 3.0.0),
Cyclops (>= 3.0.0)
Imports:
dplyr,
bit64,
readr,
purrr,
rlang,
SqlRender (>= 1.7.0),
pROC,
ggplot2,
ParallelLogger (>= 2.0.0),
methods,
EmpiricalCalibration
Suggests:
Eunomia,
testthat,
DT,
shiny,
knitr,
rmarkdown
Remotes:
ohdsi/FeatureExtraction,
ohdsi/Eunomia
RoxygenNote: 7.1.2
Encoding: UTF-8
34 changes: 17 additions & 17 deletions MethodEvaluation.Rproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Version: 1.0
RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: No
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
BuildType: Package
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,namespace
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: No

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,namespace
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ MethodEvaluation 2.1.0

Changes:

1. Updating from 'oracleTempSchema' to 'tempEmulationSchema' for newer versions of SqlRender.

2. Added unit tests.


MethodEvaluation 2.1.0
======================

Changes:

1. Added 'ohdsiDevelopment' reference set, intended to be used when developing methods. This set is based on 76 negative controls from the LEGEND Hypertension study.

2. Now generating cohort counts when generating reference set cohorts.
Expand Down
60 changes: 37 additions & 23 deletions R/CreateReferenceSetCohorts.R

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions R/Mdrr.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file Mdrr.R
#
# Copyright 2021 Observational Health Data Sciences and Informatics
# Copyright 2022 Observational Health Data Sciences and Informatics
#
# This file is part of MethodEvaluation
#
Expand Down Expand Up @@ -28,9 +28,10 @@
#' function \code{createConnectionDetails} in the
#' \code{DatabaseConnector} package.
#' @param cdmDatabaseSchema Name of database schema that contains OMOP CDM and vocabulary.
#' @param oracleTempSchema For Oracle only: the name of the database schema where you want all
#' temporary tables to be managed. Requires create/insert permissions
#' to this database.
#' @param oracleTempSchema DEPRECATED: use `tempEmulationSchema` instead.
#' @param tempEmulationSchema Some database platforms like Oracle and Impala do not truly support temp tables. To
#' emulate temp tables, provide a schema with write privileges where temp tables
#' can be created.
#' @param exposureOutcomePairs A data frame with at least two columns:
#' \itemize{
#' \item {"exposureId" or "targetId" containing the drug_concept_ID or
Expand Down Expand Up @@ -80,13 +81,18 @@
#' @export
computeMdrr <- function(connectionDetails,
cdmDatabaseSchema,
oracleTempSchema = cdmDatabaseSchema,
oracleTempSchema = NULL,
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
exposureOutcomePairs,
exposureDatabaseSchema = cdmDatabaseSchema,
exposureTable = "drug_era",
outcomeDatabaseSchema = cdmDatabaseSchema,
outcomeTable = "condition_era",
cdmVersion = "5") {
if (!is.null(oracleTempSchema) && oracleTempSchema != "") {
warning("The 'oracleTempSchema' argument is deprecated. Use 'tempEmulationSchema' instead.")
tempEmulationSchema <- oracleTempSchema
}
if (is.null(exposureOutcomePairs$exposureId) && !is.null(exposureOutcomePairs$targetId))
exposureOutcomePairs$exposureId <- exposureOutcomePairs$targetId
if (is.null(exposureOutcomePairs$exposureId))
Expand Down Expand Up @@ -138,7 +144,7 @@ computeMdrr <- function(connectionDetails,
renderedSql <- SqlRender::loadRenderTranslateSql("MDRR.sql",
packageName = "MethodEvaluation",
dbms = connectionDetails$dbms,
oracleTempSchema = oracleTempSchema,
tempEmulationSchema = tempEmulationSchema,
cdm_database_schema = cdmDatabaseSchema,
exposures_of_interest = unique(exposureOutcomePairs$exposureId),
outcomes_of_interest = unique(exposureOutcomePairs$outcomeId),
Expand All @@ -161,13 +167,13 @@ computeMdrr <- function(connectionDetails,
sql <- "SELECT * FROM #mdrr"
sql <- SqlRender::translate(sql,
targetDialect = connectionDetails$dbms,
oracleTempSchema = oracleTempSchema)
tempEmulationSchema = tempEmulationSchema)
mdrr <- DatabaseConnector::querySql(conn, sql, snakeCaseToCamelCase = TRUE)

renderedSql <- SqlRender::loadRenderTranslateSql("MDRR_Drop_temp_tables.sql",
packageName = "MethodEvaluation",
dbms = connectionDetails$dbms,
oracleTempSchema = oracleTempSchema)
tempEmulationSchema = tempEmulationSchema)
DatabaseConnector::executeSql(conn, renderedSql, progressBar = FALSE, reportOverallTime = FALSE)

mdrr <- data.frame(exposureId = mdrr$drugConceptId,
Expand Down
2 changes: 1 addition & 1 deletion R/MethodEvaluation.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file MethodEvaluation.R
#
# Copyright 2021 Observational Health Data Sciences and Informatics
# Copyright 2022 Observational Health Data Sciences and Informatics
#
# This file is part of MethodEvaluation
#
Expand Down
2 changes: 1 addition & 1 deletion R/Metrics.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file Metrics.R
#
# Copyright 2021 Observational Health Data Sciences and Informatics
# Copyright 2022 Observational Health Data Sciences and Informatics
#
# This file is part of MethodEvaluation
#
Expand Down
2 changes: 1 addition & 1 deletion R/Plots.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @file Plots.R
#
# Copyright 2021 Observational Health Data Sciences and Informatics
# Copyright 2022 Observational Health Data Sciences and Informatics
#
# This file is part of MethodEvaluation
#
Expand Down
Loading

0 comments on commit 0dbfe63

Please sign in to comment.