YODA
Organizational principles for Datasets

DataLad Datasets for data analysis

  • Datasets can have any structure.
  • Data analyses benefit from structuring following YODA principles:
P1: One thing, one dataset
P2: Record where you got it from, and where it is now
P3: Record what you did to it, and with what



Find out more about the YODA principles in the handbook, and more about structuring dataset at psychoinformatics-de.github.io/rdm-course/02-structuring-data
## P1: One thing, one dataset ![](../pics/dataset_modules.png) - Create **modular** datasets: Whenever a particular collection of files could anyhow be useful in more than one context (e.g. data), put them in their own dataset, and install it as a subdataset. - Keep everything **structured**: Bundle all components of one analysis into one superdataset, and within this dataset, separate code, data, output, execution environments. - Keep a dataset **self-contained**, with relative paths in scripts to subdatasets or files. Do not use absolute paths.

Why Modularity?

Why Modularity?

  • 3. Transparency

  • Original:
    
    /dataset
    ├── sample1
    │   └── a001.dat
    ├── sample2
    │   └── a001.dat
    ...
    
    Without modularity, after applied transform (preprocessing, analysis, ...):
    
    /dataset
    ├── sample1
    │   ├── ps34t.dat
    │   └── a001.dat
    ├── sample2
    │   ├── ps34t.dat
    │   └── a001.dat
    ...
    
    Without expert/domain knowledge, no distinction between original and derived data possible.

Why Modularity?

  • 3. Transparency

  • Original:
    
    /raw_dataset
    ├── sample1
    │   └── a001.dat
    ├── sample2
    │   └── a001.dat
    ...
    
    With modularity after applied transform (preprocessing, analysis, ...)
    
    /derived_dataset
    ├── sample1
    │   └── ps34t.dat
    ├── sample2
    │   └── ps34t.dat
    ├── ...
    └── inputs
        └── raw
            ├── sample1
            │   └── a001.dat
            ├── sample2
            │   └── a001.dat
            ...
    
    Clearer separation of semantics, through use of pristine version of original dataset within a new, additional dataset holding the outputs.

P2: Record where you got it from, and where it is now

  • Link individual datasets to declare data-dependencies (e.g. as subdatasets).
  • Record data's origin with appropriate commands, for example to record access URLs for individual files obtained from (unstructured) sources "in the cloud".
  • Share and publish datasets for collaboration or back-up.
## P3: Record what you did to it, and with what ![](../pics/dataset_linkage_provenance.png) - Collect and store **provenance** of all contents of a dataset that you create - "Which script produced which output?", "From which data?", "In which **software environment**?" ... Record it in an ideally machine-readable way with **datalad (containers-)run**

YODA Procedure

datalad create with the YODA configuration:
$ datalad create -c yoda myanalysis
[INFO   ] Creating a new annex repo at /tmp/myanalysis
[INFO   ] Scanning for unlocked files (this may take some time)
[INFO   ] Running procedure cfg_yoda
[INFO   ] == Command start (output follows) =====
[INFO   ] == Command exit (modification check follows) =====
create(ok): /tmp/myanalysis (dataset) 
Outcome: Useful pre-structuring and configurations:
$ tree
.
├── CHANGELOG.md
├── code
│   └── README.md
└── README.md