Skip to content

Commit

Permalink
Merge pull request #37 from UW-GAC/phenotype/update-diabetes-dprism-v…
Browse files Browse the repository at this point in the history
…ariables

Update diabetes dprism variables
  • Loading branch information
amstilp authored Jun 11, 2024
2 parents 6835393 + 585dbe5 commit d34285e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 29 deletions.
22 changes: 18 additions & 4 deletions PRIMED_phenotype_data_model.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "PRIMED Phenotype Data Model",
"description": "Data model for phenotype data in the PRIMED consortium",
"version": "1.8",
"version": "1.9",
"tables": [
{
"table": "subject",
Expand Down Expand Up @@ -865,7 +865,7 @@
{
"table": "diabetes_diabetes",
"url": "https://docs.google.com/spreadsheets/d/1Zc1ALFmFI8kD_bn0n-u_HfRpZjOpSf10nM-lOuTiS6s/edit#gid=597696160",
"version": "1.1",
"version": "1.2",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -909,18 +909,32 @@
"notes": "0 = 'no' 1 = 'yes' Missing values can either be left blank or set to NA."
},
{
"column": "t1d_dprism_1",
"column": "t1d_dprism_ehr_1",
"description": "indicator of Type 1 Diabetes",
"data_type": "enumeration",
"enumerations": ["0", "1"],
"notes": "0 = 'no' 1 = 'yes' Missing values can either be left blank or set to NA."
},
{
"column": "t2d_dprism_1",
"column": "t1d_dprism_ehr_plus_1",
"description": "indicator of Type 1 Diabetes, including self-report",
"data_type": "enumeration",
"enumerations": ["0", "1"],
"notes": "0 = 'no' 1 = 'yes' Missing values can either be left blank or set to NA."
},
{
"column": "t2d_dprism_ehr_1",
"description": "indicator of Type 2 Diabetes",
"data_type": "enumeration",
"enumerations": ["0", "1"],
"notes": "0 = 'no' 1 = 'yes' Missing values can either be left blank or set to NA."
},
{
"column": "t2d_dprism_ehr_plus_1",
"description": "indicator of Type 2 Diabetes, including self-report",
"data_type": "enumeration",
"enumerations": ["0", "1"],
"notes": "0 = 'no' 1 = 'yes' Missing values can either be left blank or set to NA."
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion sheets_to_JSON_phenotype.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ library(jsonlite)
url <- "https://docs.google.com/spreadsheets/d/1kpWz-6QfjMPVtm62fQwm4hoxzXhR0dnKxVt02fbx9ks"
model_name <- "PRIMED Phenotype Data Model"
model_description <- "Data model for phenotype data in the PRIMED consortium"
model_version <-"1.8"
model_version <-"1.9"

# table metadata
meta <- read_sheet(url, sheet="Description", skip=1, col_types="c") %>%
Expand Down
42 changes: 21 additions & 21 deletions test_data/diabetes_diabetes.tsv
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
subject_id age_at_obs visit t1d_1 t2d_1 t1d_dprism_1 t2d_dprism_1
subject1 59 visit_1 0 0 0 0
subject2 46 visit_1 0 1 0 0
subject3 55 visit_1 0 0 0 0
subject4 55 visit_1 0 0 0 0
subject5 62 visit_1 0 0 0 0
subject6 55 visit_1 0 0 0 0
subject7 61 visit_1 0 0 0 0
subject8 65 visit_1 0 0 0 0
subject9 66 visit_1 0 0 0 0
subject10 51 visit_1 0 0 0 1
subject11 61 visit_1 0 0 0 0
subject12 55 visit_1 0 0 0 0
subject13 52 visit_1 0 0 0 0
subject14 66 visit_1 1 0 0 0
subject15 57 visit_1 0 0 0 0
subject16 57 visit_1 0 1 0 0
subject17 67 visit_1 1 0 0 0
subject18 59 visit_1 0 0 0 0
subject19 67 visit_1 1 0 0 0
subject20 62 visit_1 0 0 0 0
subject_id age_at_obs visit t1d_1 t2d_1 t1d_dprism_ehr_1 t1d_dprism_ehr_plus_1 t2d_dprism_ehr_1 t2d_dprism_ehr_plus_1
subject1 59 visit_1 0 0 0 0 0 0
subject2 46 visit_1 0 1 0 0 0 0
subject3 55 visit_1 0 0 0 0 0 0
subject4 55 visit_1 0 0 0 0 0 0
subject5 62 visit_1 0 0 0 0 0 0
subject6 55 visit_1 0 0 0 0 0 0
subject7 61 visit_1 0 0 0 0 0 0
subject8 65 visit_1 0 0 0 0 1 0
subject9 66 visit_1 0 0 0 0 0 1
subject10 51 visit_1 0 0 0 1 0 0
subject11 61 visit_1 0 0 0 0 0 0
subject12 55 visit_1 0 0 0 0 0 0
subject13 52 visit_1 0 0 0 0 0 0
subject14 66 visit_1 1 0 0 0 0 0
subject15 57 visit_1 0 0 0 0 0 0
subject16 57 visit_1 0 1 0 0 0 0
subject17 67 visit_1 1 0 0 0 0 0
subject18 59 visit_1 0 0 0 0 0 0
subject19 67 visit_1 1 0 0 0 0 0
subject20 62 visit_1 0 0 0 0 0 0
2 changes: 1 addition & 1 deletion test_data/phenotype_harmonized.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cmqt_lipids 17ce825be3d94425e26c08987fa78cd9 gs://fc-e3b6ff37-761e-4e53-89c0-fb2
cmqt_hematology 155f8eac3c84a91fdb17eff3739e7799 gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/cmqt_hematology.tsv gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/readme.tsv 20 20
cmqt_glycemic 4af06300bac223b5462356532fa98729 gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/cmqt_glycemic.tsv gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/readme.tsv 20 20
cmqt_kidney_function 35962811d3e9c081de82e4f3f8e4bfb5 gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/cmqt_kidney_function.tsv gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/readme.tsv 20 20
diabetes_diabetes bf4ff29e1312614c66a08a27b4d129c5 gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/diabetes_diabetes.tsv gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/readme.tsv 20 20
diabetes_diabetes cc22b4c190d773f5c9f27065ce6e32ce gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/diabetes_diabetes.tsv gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/readme.tsv 20 20
cvd_cad 26439afc298880695450a008d3f92290 gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/cvd_cad.tsv gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/readme.tsv 20 20
cancer_breast 322959303fc4c173f503aaea46fbccbf gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/cancer_breast.tsv gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/readme.tsv 20 20
cancer_prostate af65adca42868373afc81bef2dd2cd2b gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/cancer_prostate.tsv gs://fc-e3b6ff37-761e-4e53-89c0-fb243b8bd8e5/test_data/readme.tsv 20 20
Expand Down
6 changes: 4 additions & 2 deletions test_data/test_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ diabetes_diabetes <- tibble(
visit=rep("visit_1", n),
t1d_1=sample(x = c(0, 1), size = n, replace = TRUE, prob = c(0.95, 0.05)),
t2d_1=sample(x = c(0, 1), size = n, replace = TRUE, prob = c(0.95, 0.05)),
t1d_dprism_1=sample(x = c(0, 1), size = n, replace = TRUE, prob = c(0.95, 0.05)),
t2d_dprism_1=sample(x = c(0, 1), size = n, replace = TRUE, prob = c(0.95, 0.05)),
t1d_dprism_ehr_1=sample(x = c(0, 1), size = n, replace = TRUE, prob = c(0.95, 0.05)),
t1d_dprism_ehr_plus_1=sample(x = c(0, 1), size = n, replace = TRUE, prob = c(0.95, 0.05)),
t2d_dprism_ehr_1=sample(x = c(0, 1), size = n, replace = TRUE, prob = c(0.95, 0.05)),
t2d_dprism_ehr_plus_1=sample(x = c(0, 1), size = n, replace = TRUE, prob = c(0.95, 0.05)),
)

set.seed(4)
Expand Down

0 comments on commit d34285e

Please sign in to comment.