neurobagel / bulk_annotations

Retroactively annotate a large number of BIDS datasets at once
MIT License
0 stars 1 forks source link

Add helper Python script to parse dataset name using pybids if exists #21

Closed alyssadai closed 1 year ago

alyssadai commented 1 year ago

Related to #20

Currently when CLI is run using bagel pheno, the value passed for the --name argument is the OpenNeuro dataset ID instead of the human-readable name.

https://github.com/neurobagel/bulk_annotations/blob/e4a94909a2fc636ed4340acf1331b9beec028beb/run_bagel_cli.sh#L22

To remedy this, a script should first be run as part of https://github.com/neurobagel/bulk_annotations/blob/main/parallel_bagel.sh which checks if a dataset_description.json file exists in the dataset and if so, whether there is a "name" key (both should be required according to https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#dataset-description), & then prints that name to stdout to be echoed. The shell script should echo the dataset ID instead if no name exists.