-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from OHDSI/internal_shiny
shiny in inst
- Loading branch information
Showing
19 changed files
with
3,520 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
This shiny app presents the results from PhenotypeR | ||
|
||
The PhenotypeR package helps us to assess the research-readiness of a set of cohorts we have defined. This assessment includes: | ||
|
||
- ___Database diagnostics___ which help us to better understand the database in which they have been created. This includes information about the size of the data, the time period covered, the number of people in the data as a whole. More granular information that may influence analytic decisions, such as the number of observation periods per person, is also described. | ||
- ___Codelist diagnostics___ which help to answer questions like what concepts from our codelist are used in the database? What concepts were present led to individuals' entry in the cohort? Are there any concepts being used in the database that we didn't include in our codelist but maybe we should have? | ||
- ___Cohort diagnostics___ which help to answer questions like how many individuals did we include in our cohort and how many were excluded because of our inclusion criteria? If we have multiple cohorts, is there overlap between them and when do people enter one cohort relative to another? What is the incidence of cohort entry and what is the prevalence of the cohort in the database? | ||
- ___Matched diagnostics___ which compares our study cohorts to the overall population in the database. By matching people in the cohorts to people with a similar age and sex in the database we can see how our cohorts differ from the general database population. | ||
- ___Population diagnostics___ which estimates the frequency of our study cohorts in the database in terms of their incidence rates and prevalence.. | ||
|
||
<div style="display: flex; align-items: center; justify-content: flex-end; gap: 10px;"> | ||
<a href="https://github.com/OHDSI/PhenotypeR" target="_blank"> | ||
<img src="phenotyper_logo.png" alt="PhenotypeR Logo" style="width: 100px;"> | ||
</a> | ||
<a href="https://github.com/OHDSI/PhenotypeR" target="_blank"> | ||
<img src="ohdsi_logo.svg" alt="OHDSI Logo" style="width: 100px;"> | ||
</a> | ||
</div> | ||
|
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
library(bslib) | ||
library(CodelistGenerator) | ||
library(CohortCharacteristics) | ||
library(DiagrammeR) | ||
library(dplyr) | ||
library(DT) | ||
library(ggplot2) | ||
library(gt) | ||
library(here) | ||
library(IncidencePrevalence) | ||
library(OmopSketch) | ||
library(readr) | ||
library(shiny) | ||
library(sortable) | ||
library(visOmopResults) | ||
library(shinycssloaders) | ||
library(shinyWidgets) | ||
library(plotly) | ||
library(tidyr) | ||
|
||
source(file.path(getwd(),"scripts", "functions.R")) | ||
|
||
if(file.exists(file.path(getwd(), "data", "appData.RData"))){ | ||
load(file.path(getwd(),"data", "appData.RData")) | ||
} else { | ||
source(file.path(getwd(),"scripts", "preprocess.R")) | ||
} | ||
|
||
plotComparedLsc <- function(lsc, cohorts){ | ||
lsc <- lsc |> tidy() | ||
plot_data <- lsc |> | ||
filter(cohort_name %in% c(cohorts | ||
)) |> | ||
select(cohort_name, | ||
variable_name, | ||
variable_level, | ||
percentage) |> | ||
pivot_wider(names_from = cohort_name, | ||
values_from = percentage) | ||
|
||
plot <- plot_data |> | ||
ggplot(aes(text = paste("Label:", variable_name, | ||
"<br>Group:", variable_level))) + | ||
geom_point(aes(x = !!sym(cohorts[1]), | ||
y = !!sym(cohorts[2]))) + | ||
geom_abline(slope = 1, intercept = 0, | ||
color = "red", linetype = "dashed") + | ||
theme_bw() | ||
|
||
ggplotly(plot) | ||
|
||
} |
Oops, something went wrong.