diff --git a/tests/data/README.md b/tests/data/README.md index 11b27b8..a7ca06e 100644 --- a/tests/data/README.md +++ b/tests/data/README.md @@ -8,8 +8,8 @@ | 2 | valid, unique `participant` and `session` IDs | same as example 1 | pass | | 3 | same as example 2 | valid BIDS data dictionary, BUT: does not contain Neurobagel `"Annotations"` key | fail | | 4 | valid, has additional columns not described in `.json` | same as example 1 | pass | -| 5 | valid, has additional unique value, not annotated in `.json` | same as example 1 | fail | -| 6 | valid, same as example 5. has assessment tool columns | valid, contains `"MissingValues"` attribute for categorical variable | pass | +| 5 | valid, has assessment tool columns | invalid, has TermURLs from unsupported vocabularies | fail | +| 6 | valid, same as example 5. | valid, contains `"MissingValues"` attribute for categorical variable | pass | | invalid | valid, only exists to be used together with the (invalid) .json | invalid, missing the `"TermURL"` attribute for identifiers | fail | | 7 | has fewer columns than are annotated in `.json` | same as example 1 | fail | | 8 | valid, based on ex2 has multiple participant_id columns | valid, based on ex2 multiple participant_id column annotations | fail* | diff --git a/tests/data/example22.json b/tests/data/example22.json deleted file mode 100644 index fa9d924..0000000 --- a/tests/data/example22.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "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": { - "PAT": "Patient", - "CTRL": "Control subject" - }, - "Annotations": { - "IsAbout": { - "TermURL": "nb:Diagnosis", - "Label": "Diagnosis" - }, - "Levels": { - "PAT": { - "TermURL": "snomed:49049000", - "Label": "Parkinson's disease" - }, - "CTRL": { - "TermURL": "ncit:C94342", - "Label": "Healthy Control" - } - }, - "MissingValues": ["OTHER"] - } - }, - "tool_item1": { - "Description": "item 1 scores for an imaginary tool", - "Annotations": { - "IsAbout": { - "TermURL": "nb:Assessment", - "Label": "Assessment tool" - }, - "IsPartOf": { - "TermURL": "unknownvocab:1234", - "Label": "Imaginary tool" - }, - "MissingValues": ["missing"] - } - }, - "tool_item2": { - "Description": "item 2 scores for an imaginary tool", - "Annotations": { - "IsAbout": { - "TermURL": "nb:Assessment", - "Label": "Assessment tool" - }, - "IsPartOf": { - "TermURL": "unknownvocab:1234", - "Label": "Imaginary tool" - }, - "MissingValues": ["missing"] - } - }, - "other_tool_item1": { - "Description": "item 1 scores for a different imaginary tool", - "Annotations": { - "IsAbout": { - "TermURL": "nb:Assessment", - "Label": "Assessment tool" - }, - "IsPartOf": { - "TermURL": "cogatlas:4321", - "Label": "A different imaginary tool" - }, - "MissingValues": ["none"] - } - } -} \ No newline at end of file diff --git a/tests/data/example22.tsv b/tests/data/example22.tsv deleted file mode 100644 index 5bf84f1..0000000 --- a/tests/data/example22.tsv +++ /dev/null @@ -1,7 +0,0 @@ -participant_id session_id group tool_item1 tool_item2 other_tool_item1 -sub-01 ses-01 PAT 11.0 "missing" "none" -sub-01 ses-02 PAT "missing" 12.0 "none" -sub-02 ses-01 OTHER "missing" "missing" "none" -sub-02 ses-02 OTHER "missing" "missing" "none" -sub-03 ses-01 CTRL 10.0 8.0 "ok" -sub-03 ses-02 CTRL 10.0 8.0 "bad" diff --git a/tests/data/example5.json b/tests/data/example5.json index 7746e4b..fa9d924 100644 --- a/tests/data/example5.json +++ b/tests/data/example5.json @@ -39,7 +39,50 @@ "TermURL": "ncit:C94342", "Label": "Healthy Control" } - } + }, + "MissingValues": ["OTHER"] + } + }, + "tool_item1": { + "Description": "item 1 scores for an imaginary tool", + "Annotations": { + "IsAbout": { + "TermURL": "nb:Assessment", + "Label": "Assessment tool" + }, + "IsPartOf": { + "TermURL": "unknownvocab:1234", + "Label": "Imaginary tool" + }, + "MissingValues": ["missing"] + } + }, + "tool_item2": { + "Description": "item 2 scores for an imaginary tool", + "Annotations": { + "IsAbout": { + "TermURL": "nb:Assessment", + "Label": "Assessment tool" + }, + "IsPartOf": { + "TermURL": "unknownvocab:1234", + "Label": "Imaginary tool" + }, + "MissingValues": ["missing"] + } + }, + "other_tool_item1": { + "Description": "item 1 scores for a different imaginary tool", + "Annotations": { + "IsAbout": { + "TermURL": "nb:Assessment", + "Label": "Assessment tool" + }, + "IsPartOf": { + "TermURL": "cogatlas:4321", + "Label": "A different imaginary tool" + }, + "MissingValues": ["none"] } } } \ No newline at end of file diff --git a/tests/data/example5.tsv b/tests/data/example5.tsv index 420e7f9..5bf84f1 100644 --- a/tests/data/example5.tsv +++ b/tests/data/example5.tsv @@ -1,5 +1,7 @@ -participant_id session_id group -sub-01 ses-01 PAT -sub-01 ses-02 PAT -sub-02 ses-01 OTHER -sub-02 ses-02 CTRL +participant_id session_id group tool_item1 tool_item2 other_tool_item1 +sub-01 ses-01 PAT 11.0 "missing" "none" +sub-01 ses-02 PAT "missing" 12.0 "none" +sub-02 ses-01 OTHER "missing" "missing" "none" +sub-02 ses-02 OTHER "missing" "missing" "none" +sub-03 ses-01 CTRL 10.0 8.0 "ok" +sub-03 ses-02 CTRL 10.0 8.0 "bad" diff --git a/tests/integration/test_cli_pheno.py b/tests/integration/test_cli_pheno.py index ad1644a..5ad778e 100644 --- a/tests/integration/test_cli_pheno.py +++ b/tests/integration/test_cli_pheno.py @@ -117,7 +117,7 @@ def test_pheno_valid_inputs_run_successfully( ["do not have unique combinations of participant and session IDs"], ), ( - "example22", + "example5", LookupError, [ "unsupported vocabulary namespace prefixes",