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

Using datalad to automate OpenNeuro CLI running #29

Merged
merged 13 commits into from
Sep 17, 2023
26 changes: 26 additions & 0 deletions datalad_get_single_dataset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

alyssadai marked this conversation as resolved.
Show resolved Hide resolved
#step1
ds_id="ds004107"
maelleF marked this conversation as resolved.
Show resolved Hide resolved

ds_portal="https://openneuro.org/datasets/${ds_id}"
maelleF marked this conversation as resolved.
Show resolved Hide resolved
GIT="[email protected]:OpenNeuroDatasets-JSONLD/${ds_id}"
bagel_dir="/home/maellef/DataBase/NeuroBagel_test/"
ldout="${bagel_dir}outputs/openneuro-jsonld/"
alyssadai marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p $ldout
out="${ldout}${ds_id}.jsonld"

workdir="${bagel_dir}${ds_id}"

datalad clone ${GIT} ${workdir}
datalad get -d $workdir "${workdir}/participants.tsv"
datalad get -d $workdir "${workdir}/participants.json"
datalad get -d $workdir "${workdir}/dataset_description.json"

ds_name=$(python extract_bids_dataset_name.py --ds $workdir)
if [ "$ds_name" == "None" ] ; then ds_name=$ds_id ; else ds_name=$ds_name ; fi

#step2
bagel pheno --pheno ${workdir}/participants.tsv --dictionary ${workdir}/participants.json --output ${workdir} --name "$ds_name" --portal $ds_portal
bagel bids --jsonld-path ${workdir}/pheno.jsonld --bids-dir ${workdir} --output ${workdir}
alyssadai marked this conversation as resolved.
Show resolved Hide resolved
cp ${workdir}/pheno_bids.jsonld ${out}