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

KBI0005: Drop a subdataset to speed up superdataset operations #21

Merged
merged 3 commits into from
Apr 18, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 46 additions & 0 deletions kbi/0005/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. index:: datalad; drop, subdataset

KBI0005: Drop a subdataset to speed up superdataset operations
==============================================================

:authors: Laura Waite <laura@waite.eu>
:discussion: https://github.com/psychoinformatics-de/knowledge-base/pull/21
:keywords: subdataset, datalad drop

In certain situations, superdatasets can contain heavy subdatasets (e.g. with
many files) that slow down dataset operations.

A common example of this is a BIDS dataset with a nested ``sourcedata``
subdataset that contains the source DICOM files from the file format conversion
to NIFTI.
mih marked this conversation as resolved.
Show resolved Hide resolved

::

bids_ds
├── sourcedata
│   └── DICOM
│   └── data1.dcm -> ../../.git/annex/objects/WF/m1/MD5E-s8--2eade17812e56a0028cb69f7813fc33c.dcm/MD5E-s8--2eade17812e56a0028cb69f7813fc33c.dcm
│   └── data2.dcm -> ../../.git/annex/objects/WF/m1/MD5E-s8--2eade17812e56a0028cb69f7813fc33c.dcm/MD5E-s8--2eade17812e56a0028cb69f7813fc33c.dcm
│   └── data3.dcm -> ../../.git/annex/objects/WF/m1/MD5E-s8--2eade17812e56a0028cb69f7813fc33c.dcm/MD5E-s8--2eade17812e56a0028cb69f7813fc33c.dcm
├── sub-01
├── sub-02
└── sub-03


Solutions
---------

Drop the subdatatset
********************

If the sourcedata does not need to be kept locally (and it already lives in
another secure location), the simplest solution is to drop the subdataset::

$ cd bids_ds
$ datalad drop -d . --what datasets sourcedata

If the sourcedata does not live in another secure location (meaning the file
content can't safely be dropped), see the `DataLad Handbook`_ for examples of
how to configure siblings to be able to push the data to a new location.

.. _DataLad Handbook: http://handbook.datalad.org/en/latest/basics/101-141-push.html#the-general-overview