Psychoinformatics lab
Institute of Neuroscience and Medicine, Brain & Behavior (INM-7), Germany
|
datalad --version
datalad --help
wtf
:
datalad wtf
git config --get user.name
git config --get user.email
git config --global user.name "Stephan Heunis"
git config --global user.email "s.heunis@fz-juelich.de"
ipython
import datalad.api as dl
dl.create(path='mydataset')
exit
text2git
config):
datalad create -c text2git bids-data
cd
(change directory):
cd bids-data
ls
:
ls -la .
echo "# A BIDS structured dataset for my input data" > README.md
status
of the dataset:
datalad status
save
datalad save -m "Add a short README"
echo "Contains functional task data of one subject" >> README.md
datalad save -m "Add information on the dataset contents to the README"
git log
clone
:
cd ../
datalad clone \
https://github.com/psychoinformatics-de/studyforrest-data-phase2.git
cd studyforrest-data-phase2
ls
du -sh # this will print the size of the directory in human readable sizes
datalad status --annex
get
(here, multiple files):
# get all files of sub-01 for all functional runs of the localizer task
datalad get \
sub-01/ses-localizer/func/sub-01_ses-localizer_task-objectcategories_run-*.nii.gz
drop
it:
# drop a specific file
datalad drop \
sub-01/ses-localizer/func/sub-01_ses-localizer_task-objectcategories_run-4_bold.nii.gz
get
it:
# get a specific file
datalad drop \
sub-01/ses-localizer/func/sub-01_ses-localizer_task-objectcategories_run-4_bold.nii.gz
get
what you want when you need it,
and drop
the rest.
cd ../bids-data
-d/--dataset
flag):
datalad clone --dataset . \
https://github.com/datalad/example-dicom-functional.git \
inputs/rawdata
datalad clone -d . \
https://github.com/ReproNim/containers.git \
code/containers
subdatasets
command:
datalad subdatasets
datalad run
can run any command in a way that links the command or script to the results it produces and the data it was computed fromdatalad rerun
can take this recorded provenance and recompute the commanddatalad containers-run
(from the extension) can capture software provenance in the form of software containers in addition to the provenance that datalad run capturesdatalad-container
extension, we can inspect the list of registered containers (recursively):
datalad containers-list --recursive
repronim-reproin
container for dicom conversion.
containers-run
command:
datalad containers-run -m "Convert subject 02 to BIDS" \
--container-name code/containers/repronim-reproin \
--input inputs/rawdata/dicoms \
--output sub-02 \
"-f reproin -s 02 --bids -l '' --minmeta -o . --files inputs/rawdata/dicoms"
containers-run
command has completed?
datalad diff
(based on git diff
):
datalad diff -f HEAD~1
git log -n 1
siblings
to a dataset, to which data can be published with push
.
datalad siblings add -d . \
--name gin \
--url git@gin.g-node.org:/your-gin-username/bids-data.git
siblings
command:
datalad siblings
datalad push --to gin
cd ../
datalad create -c yoda myanalysis
cd myanalysis
datalad clone -d . \
https://gin.g-node.org/your-gin-username/bids-data \
input
download-url
which gets the content of a script and registers its source:
datalad download-url -m "Download code for brain masking from Github" \
-O code/get_brainmask.py \
https://raw.githubusercontent.com/datalad-handbook/resources/master/get_brainmask.py
datalad-container
extension to register a container to the new dataset:
datalad containers-add nilearn \
--url shub://adswa/nilearn-container:latest \
--call-fmt "singularity exec {img} {cmd}"
datalad containers-run -m "Compute brain mask" \
-n nilearn \
--input input/sub-02/func/sub-02_task-oneback_run-01_bold.nii.gz \
--output figures/ \
--output "sub-02*" \
"python code/get_brainmask.py"
git log sub-02_brain-mask.nii.gz
datalad rerun