Skip to content

Commit

Permalink
Merge pull request #24 from UW-GAC/phen_table_versions
Browse files Browse the repository at this point in the history
add version numbers to phenotype tables
  • Loading branch information
smgogarten authored Oct 4, 2023
2 parents 937d2d9 + c9ff382 commit 308cc3e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
19 changes: 18 additions & 1 deletion 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.3",
"version": "1.4",
"tables": [
{
"table": "subject",
Expand Down Expand Up @@ -57,6 +57,7 @@
{
"table": "population_descriptor",
"url": "https://docs.google.com/spreadsheets/d/1kpWz-6QfjMPVtm62fQwm4hoxzXhR0dnKxVt02fbx9ks/edit#gid=1733510035",
"version": "1.0",
"columns": [
{
"column": "population_descriptor_id",
Expand Down Expand Up @@ -203,6 +204,7 @@
{
"table": "pilot",
"url": "https://docs.google.com/spreadsheets/d/1bo_I8_yOx0sXK9UcNAJ8b8DoKe8O3W4S9zzZG-y0thM/edit#gid=0",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -278,6 +280,7 @@
{
"table": "cmqt_flags",
"url": "https://docs.google.com/spreadsheets/d/1vQE4gHvKQUOLPaRt1bpLLfNUFp2st9qOl56zD57gob0/edit#gid=0",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -422,6 +425,7 @@
{
"table": "cmqt_anthropometry",
"url": "https://docs.google.com/spreadsheets/d/1vQE4gHvKQUOLPaRt1bpLLfNUFp2st9qOl56zD57gob0/edit#gid=1206657525",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -475,6 +479,7 @@
{
"table": "cmqt_blood_pressure",
"url": "https://docs.google.com/spreadsheets/d/1vQE4gHvKQUOLPaRt1bpLLfNUFp2st9qOl56zD57gob0/edit#gid=455811479",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -511,12 +516,19 @@
"description": "Resting diastolic blood pressure from the upper arm in a clinical setting",
"data_type": "float",
"examples": "80"
},
{
"column": "hypertension_1",
"description": "<description>",
"data_type": "enumeration",
"enumerations": ["0", "1"]
}
]
},
{
"table": "cmqt_lipids",
"url": "https://docs.google.com/spreadsheets/d/1vQE4gHvKQUOLPaRt1bpLLfNUFp2st9qOl56zD57gob0/edit#gid=1052869785",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -576,6 +588,7 @@
{
"table": "cmqt_hematology",
"url": "https://docs.google.com/spreadsheets/d/1vQE4gHvKQUOLPaRt1bpLLfNUFp2st9qOl56zD57gob0/edit#gid=1535206686",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -681,6 +694,7 @@
{
"table": "cmqt_glycemic",
"url": "https://docs.google.com/spreadsheets/d/1vQE4gHvKQUOLPaRt1bpLLfNUFp2st9qOl56zD57gob0/edit#gid=2078107573",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -731,6 +745,7 @@
{
"table": "cmqt_kidney_function",
"url": "https://docs.google.com/spreadsheets/d/1vQE4gHvKQUOLPaRt1bpLLfNUFp2st9qOl56zD57gob0/edit#gid=746527944",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -771,6 +786,7 @@
{
"table": "diabetes_diabetes",
"url": "https://docs.google.com/spreadsheets/d/1vQE4gHvKQUOLPaRt1bpLLfNUFp2st9qOl56zD57gob0/edit#gid=1891810958",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down Expand Up @@ -815,6 +831,7 @@
{
"table": "cvd_cad",
"url": "https://docs.google.com/spreadsheets/d/1gchIrBIPt2s_3uVEloUK1c1Rst6IxnbBm7Zwps2k31I/edit#gid=253559161",
"version": "1.0",
"columns": [
{
"column": "subject_id",
Expand Down
6 changes: 3 additions & 3 deletions sheets_to_JSON_phenotype.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ 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.3"
model_version <-"1.4"

# table metadata
meta <- read_sheet(url, sheet="Description", skip=1) %>%
select(table=Table, required=Required, url=Link) %>%
meta <- read_sheet(url, sheet="Description", skip=1, col_types="c") %>%
select(table=Table, required=Required, url=Link, version=Version) %>%
filter(!is.na(url)) # only keep tables with links

#table_names <- meta$table
Expand Down

0 comments on commit 308cc3e

Please sign in to comment.