Skip to content

Commit 9d171e5

Browse files
authored
Merge pull request #2050 from effigies/feat/phenotype-datatype
[ENH] Define "phenotype" as a data type not nested inside subjects
2 parents 67467c7 + 201222f commit 9d171e5

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

src/schema/objects/common_principles.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ data_type:
1313
description: |
1414
A functional group of different types of data.
1515
Data files are contained in a directory named for the data type.
16-
In raw datasets, the data type directory is nested inside subject and (optionally) session directories.
1716
BIDS defines the following data types:
1817
1918
1. `func` (task based and resting state functional MRI)
@@ -44,6 +43,13 @@ data_type:
4443
4544
14. `mrs` (magnetic resonance spectroscopy)
4645
46+
15. `phenotype` (measurement and survey data)
47+
48+
For files that are subject- and session- specific, the data type directory
49+
is nested inside those directories.
50+
`phenotype` data files are aggregated across subjects and sessions,
51+
and so the `phenotype/` directory is placed in the dataset root.
52+
4753
dataset:
4854
display_name: Dataset
4955
description: |

src/schema/objects/datatypes.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ pet:
6161
display_name: Positron Emission Tomography
6262
description: |
6363
Positron emission tomography data
64+
phenotype:
65+
value: phenotype
66+
display_name: Phenotype
67+
description: |
68+
Participant level measurement data
69+
(for example, responses from multiple questionnaires)
70+
split into individual files separate from `participants.tsv`.
6471
nirs:
6572
value: nirs
6673
display_name: Near-Infrared Spectroscopy

tools/schemacode/src/bidsschematools/__main__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ def pre_receive_hook(schema, input_, output):
149149
)
150150

151151
regexes = [rule["regex"] for rule in all_rules]
152-
# XXX Hack for phenotype files - this can be removed once we
153-
# have a schema definition for them
154-
regexes.append(r"phenotype/.*\.(tsv|json)")
155152

156153
output = sys.stdout if output == "-" else open(output, "w")
157154

tools/schemacode/src/bidsschematools/data/tests/test_rules.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ def test_rule_objects(schema_obj):
101101

102102
# Build a list of items mentioned in rules, but not found in objects.
103103
if use not in object_values:
104-
if (use, object_type) == ("phenotype", "datatypes"):
105-
# Special case: phenotype is a top-level directory
106-
# that acts like a datatype, but we don't want to
107-
# define it that way in the glossary, currently.
108-
continue
109104
temp_path = path[:]
110105
if is_list:
111106
temp_path[-1] += f"[{i_use}]"

0 commit comments

Comments
 (0)