diff --git a/DESCRIPTION b/DESCRIPTION index 8f7a543..f9ef5fb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Characterization Type: Package Title: Characterizations of Cohorts -Version: 0.1.5 +Version: 0.2.0 Date: 2024-04-03 Authors@R: c( person("Jenna", "Reps", , "reps@ohdsi.org", role = c("aut", "cre")), @@ -17,7 +17,7 @@ Depends: Imports: Andromeda, DatabaseConnector (>= 6.3.1), - FeatureExtraction (>= 3.0.0), + FeatureExtraction (>= 3.5.0), SqlRender (>= 1.9.0), ParallelLogger (>= 3.0.0), checkmate, diff --git a/NEWS.md b/NEWS.md index acf123e..c004996 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +Characterization 0.2.0 +====================== +Updated dependency to FeatureExtraction (>= 3.5.0) to support minCharacterizationMean paramater. + + Characterization 0.1.5 ====================== Changed export to csv approach to use batch export from SQLite (#41) diff --git a/R/AggregateCovariates.R b/R/AggregateCovariates.R index bad74ec..2f043f9 100644 --- a/R/AggregateCovariates.R +++ b/R/AggregateCovariates.R @@ -21,6 +21,9 @@ #' @param minPriorObservation The minimum time in the database a patient in the target cohorts must be observed prior to index #' @template timeAtRisk #' @param covariateSettings An object created using \code{FeatureExtraction::createCovariateSettings} +#' @param minCharacterizationMean The minimum mean value for characterization output. Values below this will be cut off from output. This +#' will help reduce the file size of the characterization output, but will remove information +#' on covariates that have very low values. The default is 0. #' #' @return #' A list with the settings @@ -34,7 +37,8 @@ createAggregateCovariateSettings <- function( startAnchor = "cohort start", riskWindowEnd = 365, endAnchor = "cohort start", - covariateSettings) { + covariateSettings, + minCharacterizationMean = 0) { errorMessages <- checkmate::makeAssertCollection() # check targetIds is a vector of int/double .checkCohortIds( @@ -81,7 +85,8 @@ createAggregateCovariateSettings <- function( startAnchor = startAnchor, riskWindowEnd = riskWindowEnd, endAnchor = endAnchor, - covariateSettings = covariateSettings + covariateSettings = covariateSettings, + minCharacterizationMean = minCharacterizationMean ) class(result) <- "aggregateCovariateSettings" @@ -163,7 +168,8 @@ computeAggregateCovariateAnalyses <- function( cohortId = -1, covariateSettings = aggregateCovariateSettings$covariateSettings, cdmVersion = cdmVersion, - aggregated = T + aggregated = T, + minCharacterizationMean = aggregateCovariateSettings$minCharacterizationMean ) # adding counts as a new table result$cohortCounts <- counts diff --git a/README.md b/README.md index 05b19e2..b3668ec 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ targetIds <- c(1,2,4) useDemographicsAge = T, useDemographicsRace = T ) - ) + ) aggregateCovariateSettings2 <- createAggregateCovariateSettings( targetIds = targetIds, diff --git a/docs/404.html b/docs/404.html index a8cd17d..16fc3ae 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ Characterization - 0.1.5 + 0.2.0 @@ -71,7 +71,7 @@
vignettes/InstallationGuide.Rmd
InstallationGuide.Rmd
vignettes/UsingCharacterizationPackage.Rmd
UsingCharacterizationPackage.Rmd
## Connecting using SQLite driver
## Creating cohort: Celecoxib
## | | | 0% | |======================================================================| 100%
-## Executing SQL took 0.0152 secs
+## Executing SQL took 0.0138 secs
## Creating cohort: Diclofenac
## | | | 0% | |======================================================================| 100%
-## Executing SQL took 0.0169 secs
+## Executing SQL took 0.0122 secs
## Creating cohort: GiBleed
## | | | 0% | |======================================================================| 100%
-## Executing SQL took 0.0208 secs
+## Executing SQL took 0.0228 secs
## Creating cohort: NSAIDs
## | | | 0% | |======================================================================| 100%
-## Executing SQL took 0.0579 secs
+## Executing SQL took 0.0641 secs
## Cohorts created in table main.cohort
## cohortId name
## 1 1 Celecoxib
@@ -245,14 +245,16 @@ Aggreagate CovariatesIf we want to create the aggregate features for all our target
cohorts, our outcome cohort and each target cohort restricted to those
with a record of the outcome 1 day after target cohort start date until
-365 days after target cohort end date we can run:
+365 days after target cohort end date, excluding mean values below 0.01,
+we can run:
exampleAggregateCovariateSettings <- createAggregateCovariateSettings(
targetIds = exampleTargetIds,
outcomeIds = exampleOutcomeIds,
riskWindowStart = 1, startAnchor = "cohort start",
riskWindowEnd = 365, endAnchor = "cohort start",
- covariateSettings = exampleCovariateSettings
+ covariateSettings = exampleCovariateSettings,
+ minCharacterizationMean = 0.01
)
Next we need to use the
exampleAggregateCovariateSettings
as the settings to
@@ -3207,8 +3209,8 @@
Dechallenge Rechallenge## Connecting using SQLite driver
## Computing dechallenge rechallenge results
## | | | 0% | |============ | 17% | |======================= | 33% | |=================================== | 50% | |=============================================== | 67% | |========================================================== | 83% | |======================================================================| 100%
-## Executing SQL took 0.00758 secs
-## Computing dechallenge rechallenge for 3 target ids and 1outcome ids took 0.165 secs
+## Executing SQL took 0.00901 secs
+## Computing dechallenge rechallenge for 3 target ids and 1outcome ids took 0.138 secs
If you would like to save the results you can use the function
saveDechallengeRechallengeAnalyses
and this can then be
loaded using loadDechallengeRechallengeAnalyses
.
## Connecting using SQLite driver
## Computing dechallenge rechallenge results
## | | | 0% | |============ | 17% | |======================= | 33% | |=================================== | 50% | |=============================================== | 67% | |========================================================== | 83% | |======================================================================| 100%
-## Executing SQL took 0.0748 secs
-## Computing dechallenge failed case series for 3 target IDs and 1 outcome IDs took 0.219 secs
+## Executing SQL took 0.0966 secs
+## Computing dechallenge failed case series for 3 target IDs and 1 outcome IDs took 0.202 secs
The results are Andromeda objects that can we viewed using
dplyr
. There is just one table named
rechallengeFailCaseSeries:
## | | | 0% | |=== | 4% | |====== | 8% | |========= | 12% | |============ | 17% | |=============== | 21% | |================== | 25% | |==================== | 29% | |======================= | 33% | |========================== | 38% | |============================= | 42% | |================================ | 46% | |=================================== | 50% | |====================================== | 54% | |========================================= | 58% | |============================================ | 62% | |=============================================== | 67% | |================================================== | 71% | |==================================================== | 75% | |======================================================= | 79% | |========================================================== | 83% | |============================================================= | 88% | |================================================================ | 92% | |=================================================================== | 96% | |======================================================================| 100%
-## Executing SQL took 0.0462 secs
-## Computing time-to-event for T-O pairs took 0.268 secs
+## Executing SQL took 0.0525 secs
+## Computing time-to-event for T-O pairs took 0.22 secs
If you would like to save the results you can use the function
saveTimeToEventAnalyses
and this can then be loaded using
loadTimeToEventAnalyses
.
NEWS.md
+ Updated dependency to FeatureExtraction (>= 3.5.0) to support minCharacterizationMean paramater.
+Changed export to csv approach to use batch export from SQLite (#41)
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index c233713..b99de08 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -4,5 +4,5 @@ pkgdown_sha: ~ articles: InstallationGuide: InstallationGuide.html UsingCharacterizationPackage: UsingCharacterizationPackage.html -last_built: 2024-04-03T18:44Z +last_built: 2024-04-19T17:04Z diff --git a/docs/pull_request_template.html b/docs/pull_request_template.html index 3935c1f..e4de9b2 100644 --- a/docs/pull_request_template.html +++ b/docs/pull_request_template.html @@ -17,7 +17,7 @@ Characterization - 0.1.5 + 0.2.0An object created using FeatureExtraction::createCovariateSettings
The minimum mean value for characterization output. Values below this will be cut off from output. This +will help reduce the file size of the characterization output, but will remove information +on covariates that have very low values. The default is 0.