From 767b57b976fc7549e0b2974e30bb728fb3c352b0 Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 11 Jun 2024 14:18:48 -0700 Subject: [PATCH 1/2] Rename existing ehr variable and add new ehr_plus variable --- PRIMED_phenotype_data_model.json | 22 ++++++++++++++++++---- sheets_to_JSON_phenotype.R | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/PRIMED_phenotype_data_model.json b/PRIMED_phenotype_data_model.json index 6184cc9..d7ce7c9 100755 --- a/PRIMED_phenotype_data_model.json +++ b/PRIMED_phenotype_data_model.json @@ -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", @@ -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", @@ -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." } ] }, diff --git a/sheets_to_JSON_phenotype.R b/sheets_to_JSON_phenotype.R index 683bd35..714fc07 100644 --- a/sheets_to_JSON_phenotype.R +++ b/sheets_to_JSON_phenotype.R @@ -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") %>% From 585dbe507bae3cec80d7c44a05cde6e21c34ccfa Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Tue, 11 Jun 2024 14:19:45 -0700 Subject: [PATCH 2/2] Update test data for new diabetes variables --- test_data/diabetes_diabetes.tsv | 42 +++++++++++++++--------------- test_data/phenotype_harmonized.tsv | 2 +- test_data/test_files.R | 6 +++-- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/test_data/diabetes_diabetes.tsv b/test_data/diabetes_diabetes.tsv index c5c6440..8ef8bb7 100644 --- a/test_data/diabetes_diabetes.tsv +++ b/test_data/diabetes_diabetes.tsv @@ -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 diff --git a/test_data/phenotype_harmonized.tsv b/test_data/phenotype_harmonized.tsv index 36f6253..610851e 100644 --- a/test_data/phenotype_harmonized.tsv +++ b/test_data/phenotype_harmonized.tsv @@ -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 diff --git a/test_data/test_files.R b/test_data/test_files.R index 2c067d1..aaa7ca0 100644 --- a/test_data/test_files.R +++ b/test_data/test_files.R @@ -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)