-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] Handle multi-column attribute annotations (#264)
* update docstrings and type hints for clarity * add example with multiple diagnosis cols * add new example with two diagnosis columns * update test of categorical value transform * update get_transformed_values to return a list * add multi-diagnosis example subject with healthy control value * update transformed value storing for attributes that expect a single value * test subject level output with multicolumn diagnosis handling * add comment and update test data README * add example with multiple columns about age and sex * add multicolumn annotation examples to bagel pheno smoke test * add example 20 to README * remove addressed TODOs * add and test warning for multiple age/sex columns
- Loading branch information
Showing
9 changed files
with
439 additions
and
35 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"participant_id": { | ||
"Description": "A participant ID", | ||
"Annotations": { | ||
"IsAbout": { | ||
"TermURL": "nb:ParticipantID", | ||
"Label": "Unique participant identifier" | ||
}, | ||
"Identifies": "participant" | ||
} | ||
}, | ||
"session_id": { | ||
"Description": "A session ID", | ||
"Annotations": { | ||
"IsAbout": { | ||
"TermURL": "nb:SessionID", | ||
"Label": "Unique session identifier" | ||
}, | ||
"Identifies": "session" | ||
} | ||
}, | ||
"group": { | ||
"Description": "Group variable", | ||
"Levels": { | ||
"PD": "Parkinson's disease", | ||
"CTRL": "Control subject" | ||
}, | ||
"Annotations": { | ||
"IsAbout": { | ||
"TermURL": "nb:Diagnosis", | ||
"Label": "Diagnosis" | ||
}, | ||
"Levels": { | ||
"PD": { | ||
"TermURL": "snomed:49049000", | ||
"Label": "Parkinson's disease" | ||
}, | ||
"CTRL": { | ||
"TermURL": "ncit:C94342", | ||
"Label": "Healthy Control" | ||
} | ||
} | ||
} | ||
}, | ||
"diagnosis": { | ||
"Description": "Diagnosis at baseline visit", | ||
"Levels": { | ||
"PD": "Parkinson's disease", | ||
"SPD": "Sporadic Parkinson disease" | ||
}, | ||
"Annotations": { | ||
"IsAbout": { | ||
"TermURL": "nb:Diagnosis", | ||
"Label": "Diagnosis" | ||
}, | ||
"Levels": { | ||
"PD": { | ||
"TermURL": "snomed:49049000", | ||
"Label": "Parkinson's disease" | ||
}, | ||
"SPD": { | ||
"TermURL": "snomed:724761004", | ||
"Label": "Sporadic Parkinson disease" | ||
}, | ||
"AD": { | ||
"TermURL": "snomed:26929004", | ||
"Label": "Alzheimer's disease" | ||
} | ||
}, | ||
"MissingValues": [""] | ||
} | ||
}, | ||
"sex": { | ||
"Description": "Sex variable", | ||
"Levels": { | ||
"M": "Male", | ||
"F": "Female" | ||
}, | ||
"Annotations": { | ||
"IsAbout": { | ||
"TermURL": "nb:Sex", | ||
"Label": "Sex" | ||
}, | ||
"Levels": { | ||
"M": { | ||
"TermURL": "snomed:248153007", | ||
"Label": "Male" | ||
}, | ||
"F": { | ||
"TermURL": "snomed:248152002", | ||
"Label": "Female" | ||
} | ||
} | ||
} | ||
}, | ||
"participant_age": { | ||
"Description": "Age of the participant", | ||
"Annotations": { | ||
"IsAbout": { | ||
"TermURL": "nb:Age", | ||
"Label": "Chronological age" | ||
}, | ||
"Transformation": { | ||
"TermURL": "nb:FromISO8601", | ||
"Label": "A period of time defined according to the ISO8601 standard" | ||
} | ||
} | ||
} | ||
} |
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,4 @@ | ||
participant_id session_id group diagnosis sex participant_age | ||
sub-01 ses-01 PD SPD M P60Y6M | ||
sub-02 ses-01 CTRL F P56Y4M | ||
sub-03 ses-01 CTRL AD F P60Y6M |
Oops, something went wrong.