You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WARNING: this package is under-development and has only been tested using mock data
The goal of OmopSketch is to characterise and visualise an OMOP CDM
instance to asses if it meets the necessary criteria to answer a
specific clinical question and conduct a certain study.
Installation
You can install the development version of OmopSketch from
GitHub with:
We first create a snapshot of our database. This will allow us to track
when the analysis has been conducted and capture details about the CDM
version or the data release.
summariseOmopSnapshot(cdm) |>
tableOmopSnapshot(type="flextable")
#> ! Results have not been suppressed.
Characterise the clinical tables
Once we have collected the snapshot information, we can start
characteristing the clinical tables of the CDM. By using
summariseClinicalRecords() and tableClinicalRecords(), we can easily
visualise the main characteristics of specific clinical tables.
summariseClinicalRecords(cdm, c("condition_occurrence", "drug_exposure")) |>
tableClinicalRecords(type="flextable")
#> ℹ Summarising table counts#> ℹ The following estimates will be computed:#> → Start summary of data, at 2024-09-25 12:14:06.676817#> #> ✔ Summary finished, at 2024-09-25 12:14:06.815944#> ℹ Summarising records per person#> ℹ The following estimates will be computed:#> • records_per_person: mean, sd, median, q25, q75, min, max#> ! Table is collected to memory as not all requested estimates are supported on#> the database side#> → Start summary of data, at 2024-09-25 12:14:07.908258#> #> ✔ Summary finished, at 2024-09-25 12:14:07.955041#> ℹ Summarising in_observation, standard, domain_id, and type information#> ℹ Summarising table counts#> ℹ The following estimates will be computed:#> → Start summary of data, at 2024-09-25 12:14:11.725276#> #> ✔ Summary finished, at 2024-09-25 12:14:11.877293#> ℹ Summarising records per person#> ℹ The following estimates will be computed:#> • records_per_person: mean, sd, median, q25, q75, min, max#> ! Table is collected to memory as not all requested estimates are supported on#> the database side#> → Start summary of data, at 2024-09-25 12:14:12.808874#> #> ✔ Summary finished, at 2024-09-25 12:14:12.850686#> ℹ Summarising in_observation, standard, domain_id, and type information#> ! Results have not been suppressed.
We can also explore trends in the clinical table records over time.
summariseRecordCount(cdm, c("condition_occurrence", "drug_exposure")) |>
plotRecordCount(facet="omop_table")
#> ! The following column type were changed:#> • variable_level: from double to character
###
Characterise the observation period After visualising the main
characteristics of our clinical tables, we can explore the observation
period details. OmopSketch provides several functions to have an
overwied of the dataset study period.
Using summariseInObservation() and plotInObservation(), we can
gather information on the number of records per year.
summariseInObservation(cdm$observation_period, output="records") |>
plotInObservation()
#> ! The following column type were changed:#> • variable_level: from double to character
You
can also visualise and explore the characteristics of the observation
period per each individual in the database using
summariseObservationPeriod().
summariseObservationPeriod(cdm$observation_period) |>
tableObservationPeriod(type="flextable")
#> ! Results have not been suppressed.
Or if visualisation is prefered, you can easily build a histogram to
explore how many participants have more than one observation period.
OmopSketch also provides functions to explore some of (or all) the
concepts in the dataset.
acetaminophen<- c(1125315, 1127433, 1127078)
summariseConceptCounts(cdm, conceptId=list("acetaminophen"=acetaminophen)) |>
filter(estimate_name=="record_count") |>
plotConceptCounts()
#> ℹ Getting use of codes from acetaminophen#> ! The following column type were changed:#> • variable_name: from integer to character
Characterise the population
Finally, OmopSketch can also help us to characterise the population at
the start and end of the observation period.
summarisePopulationCharacteristics(cdm) |>
tablePopulationCharacteristics(type="flextable")
#> Warning: ! 1 casted column in og_015_1727262876 (cohort_set) as do not match expected#> column type:#> • `cohort_definition_id` from numeric to integer#> Warning: ! 1 column in og_015_1727262876 do not match expected column type:#> • `cohort_definition_id` is numeric but expected integer#> ! cohort columns will be reordered to match the expected order:#> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date.#> ℹ Building new trimmed cohort#> Warning: ! 1 column in tmp_011_og_017_1727262877 do not match expected column type:#> • `cohort_definition_id` is numeric but expected integer#> Creating initial cohort#> ! cohort columns will be reordered to match the expected order:#> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date.#> ! cohort columns will be reordered to match the expected order:#> cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date.#> ✔ Cohort trimmed#> ℹ adding demographics columns#> #> ℹ summarising data#> #> ✔ summariseCharacteristics finished!#> #> ! The following column type were changed:#> • variable_name: from integer to character#> ! Results have not been suppressed.
As seen, OmopSketch offers multiple functionalities to provide a general
overview of a database. Additionally, it includes more tools and
arguments that allow for deeper exploration, helping to assess the
database’s suitability for specific research studies. For further
information, please refer to the vignettes.