PhenotypeR

Review codelists and cohorts in OMOP CDM

2025-06-26

Introduction

  • PhenotypeR package is designed to review cohorts in OMOP CDM.
  • The code is publicly available in OHDSI’s GitHub repository PhenoypeR.
  • PhenotypeR 0.1.6 is available in CRAN.
  • Vignettes with further information can be found in the package website.

Set of Functions: Individual Diagnostics Assessment

  • Database diagnostics

    • Summarises the databases metadata and the observation period.
    • databaseDiagnostics()
  • Codelist diagnostics

    • Summarises the codelist use associated to our cohort.
    • codelistDiagnostics()
  • Cohort diagnostics

    • Summarises baseline characteristics, attrition, overlap, and large-scale characteristics. It also allows to compare our results with a matched cohort.
    • cohortDiagnostics()
  • Population diagnostics

    • Incidence and prevalence of our cohort in the database.
    • populationDiagnostics()

Set of Functions: Phenotype Diagnostics

  • Comprises all the diagnostics that are being offered in this package.
result <- phenotypeDiagnostics(
  cohort,
  databaseDiagnostics = TRUE,
  codelistDiagnostics = TRUE,
  cohortDiagnostics = TRUE,
  survival = TRUE,
  match = TRUE,
  matchedSample = NULL,
  populationDiagnostics = TRUE,
  populationSample = NULL,
  populationDateRange = as.Date(c(NA,NA))
)
  • Create a shiny app to visualize all the results
shinyDiagnostics(result = result, directory = here())

Run Phenotype Diagnostics - Example

library(CDMConnector)
library(CodelistGenerator)
library(CohortConstructor)
library(CohortCharacteristics)
library(dplyr)
library(PhenotypeR)
library(here)
library(omock)
library(duckdb)

# Create mock cdm
datasetName <- "synpuf-1k_5.3"
dbdir <- here(paste0(datasetName, ".duckdb"))
con <- dbConnect(drv = duckdb(dbdir = dbdir))
cdm <- mockCdmFromDataset(datasetName = datasetName)
cdm <- insertCdmTo(cdm = cdm, to = dbSource(con = con, writeSchema = "main"))

cdm <- cdm %>%
  buildAchillesTables()

# Create mock cohorts
drug_codes <- getDrugIngredientCodes(
  cdm = cdm, 
  name = c("diclofenac", "acetaminophen"),
  nameStyle = "{concept_name}"
)

cdm$medications <- conceptCohort(
  cdm = cdm, 
  conceptSet = drug_codes, 
  name = "medications"
)

# Run Phenotype Diagnostics 
result <- phenotypeDiagnostics(cdm$medications,
                               databaseDiagnostics = TRUE,
                               codelistDiagnostics = TRUE,
                               cohortDiagnostics = TRUE,
                               survival = TRUE,
                               match = TRUE,
                               matchedSample = NULL,
                               populationDiagnostics = TRUE,
                               populationSample = NULL,
                               populationDateRange = as.Date(c(NA,NA)))

shinyDiagnostics(result = result, directory = here())

Visualise the results

See the results in the shiny app

PhenotypeR

👉 Packages website
👉 CRAN link
👉 Manual

📧 marta.alcaldeherraiz@ndorms.ox.ac.uk

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app

Extra - PhenotypeR shiny app