Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] schema - specify what is valid at the root of a dataset #1108

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/schema/rules/associated_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@
# This file describes the requirement levels of directories which may appear
# within a dataset directory without following BIDS format.
code:
pattern: 'code'
type: 'directory'
required: false
derivatives:
pattern: 'derivatives'
type: 'directory'
required: false
sourcedata:
pattern: 'sourcedata'
type: 'directory'
required: false
stimuli:
pattern: 'stimuli'
type: 'directory'
required: false
2 changes: 1 addition & 1 deletion src/schema/rules/checks/func.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Rules for functional data that are not defined in tables.
---
# Rules for functional data that are not defined in tables.
PhaseSuffixDeprecated:
issue:
code: PHASE_SUFFIX_DEPRECATED
Expand Down
119 changes: 119 additions & 0 deletions src/schema/rules/filenames.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
root:
type: 'directory'
# you can call datasets whetever you want.
pattern: '.*'
children:
- subject_dirs
- $ref: rules.top_level_files
- $ref: rules.associated_data

subject_dirs:
type: 'directory'
entities:
- subject
children:
- session_dirs
- datatype_dirs
rwblair marked this conversation as resolved.
Show resolved Hide resolved
- $ref: rules.tabular_metadata

session_dirs:
type: 'directory'
entities:
- session
children:
- datatype_dirs

datatype_dirs:
- pattern: 'anat'
type: 'directory'
children:
- $ref: rules.datatypes.anat.nonparametric
- $ref: rules.datatypes.anat.parametric
- $ref: rules.datatypes.anat.defacemask
- $ref: rules.datatypes.anat.multiecho
- $ref: rules.datatypes.anat.multiflip
- $ref: rules.datatypes.anat.multiinversion
- $ref: rules.datatypes.anat.mp2rage
- $ref: rules.datatypes.anat.vfamt
- $ref: rules.datatypes.anat.mtr
- pattern: 'beh'
type: 'directory'
children:
- $ref: rules.datatypes.beh.timeseries
- $ref: rules.datatypes.beh.noncontinuous
- pattern: 'dwi'
type: 'directory'
children:
- $ref: rules.datatypes.dwi.dwi
- $ref: rules.datatypes.dwi.sbref
- $ref: rules.datatypes.dwi.timeseries
- pattern: 'eeg'
type: 'directory'
children:
- $ref: rules.datatypes.eeg.eeg
- $ref: rules.datatypes.eeg.channels
- $ref: rules.datatypes.eeg.coordsystem
- $ref: rules.datatypes.eeg.electrodes
- $ref: rules.datatypes.eeg.events
- $ref: rules.datatypes.eeg.photo
- $ref: rules.datatypes.eeg.timeseries
- pattern: 'fmap'
type: 'directory'
children:
- $ref: rules.datatypes.fmap.fieldmaps
- $ref: rules.datatypes.fmap.pepolar
- $ref: rules.datatypes.fmap.TB1DAM
- $ref: rules.datatypes.fmap.TB1EPI
- $ref: rules.datatypes.fmap.RFFieldMaps
- $ref: rules.datatypes.fmap.TB1SRGE
- $ref: rules.datatypes.fmap.parametric
- pattern: 'func'
type: 'directory'
children:
- $ref: rules.datatypes.func.func
- $ref: rules.datatypes.func.phase
- $ref: rules.datatypes.func.events
- $ref: rules.datatypes.func.timeseries
- pattern: 'ieeg'
type: 'directory'
children:
- $ref: rules.datatypes.ieeg.ieeg
- $ref: rules.datatypes.ieeg.channels
- $ref: rules.datatypes.ieeg.coordsystem
- $ref: rules.datatypes.ieeg.electrodes
- $ref: rules.datatypes.ieeg.events
- $ref: rules.datatypes.ieeg.photo
- $ref: rules.datatypes.ieeg.timeseries
- pattern: 'meg'
type: 'directory'
children:
- $ref: rules.datatypes.meg.meg
- $ref: rules.datatypes.meg.calibration
- $ref: rules.datatypes.meg.crosstalk
- $ref: rules.datatypes.meg.headshape
- $ref: rules.datatypes.meg.markers
- $ref: rules.datatypes.meg.coordsystem
- $ref: rules.datatypes.meg.channels
- $ref: rules.datatypes.meg.events
- $ref: rules.datatypes.meg.photo
- $ref: rules.datatypes.meg.timeseries
- pattern: 'micr'
type: 'directory'
children:
- $ref: rules.datatypes.micr.microscopy
- $ref: rules.datatypes.micr.photo
- pattern: 'perf'
type: 'directory'
children:
- $ref: rules.datatypes.perf.asl
- $ref: rules.datatypes.perf.aslcontext
- $ref: rules.datatypes.perf.asllabeling
- $ref: rules.datatypes.perf.timeseries
- pattern: 'pet'
type: 'directory'
children:
- $ref: rules.datatypes.pet.pet
- $ref: rules.datatypes.pet.blood
- $ref: rules.datatypes.pet.events
- $ref: rules.datatypes.pet.timeseries
7 changes: 7 additions & 0 deletions src/schema/rules/top_level_files.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
---
README:
required: true
pattern: 'README'
extensions:
- None
- .md
- .rst
- .txt
CHANGES:
required: true
pattern: 'CHANGES'
extensions:
- None
LICENSE:
required: false
pattern: 'LICENSE'
extensions:
- None
dataset_description:
required: true
pattern: 'dataset_description'
extensions:
- .json
genetic_info:
required: false
pattern: 'genetic_info'
extensions:
- .json
participants:
required: false
pattern: 'participants'
extensions:
- .tsv
- .json
samples:
required: false
pattern: 'samples'
extensions:
- .tsv
- .json