slides/modules/yoda.html

276 lines
9.3 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en">
<head>
<title>YODA</title>
<meta name="description" content="Organizational principles for Datasets">
<meta name="author" content="The DataLad Team">
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- Original reveal JS stylesheets-->
<link rel="stylesheet" href="../reveal.js/dist/reset.css">
<link rel="stylesheet" href="../reveal.js/dist/reveal.css">
<link rel="stylesheet" href="../reveal.js/dist/theme/beige.css">
<!-- custom styles, e.g., imgcredit -->
<link rel="stylesheet" href="../custom/css/main.css" id="theme">
<script src="../custom/js/printpdf.js"></script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>YODA<br><small>Organizational principles for Datasets</small></h1>
</section>
<section>
<section>
<h2>DataLad Datasets for data analysis</h2>
<ul>
<li>Datasets can have <i>any</i> structure.</li>
<li><b>Data analyses</b> benefit from structuring following <b>YODA principles</b>:</li>
</ul>
<img style="" data-src="../img/logos/yoda.svg" height="400">
<dl>
<dt>P1: One thing, one dataset</dt>
<dt>P2: Record where you got it from, and where it is now</dt>
<dt>P3: Record what you did to it, and with what</dt>
</dl>
<br><br><br><note>Find out more about the YODA principles in
<a href="http://handbook.datalad.org/en/latest/basics/101-127-yoda.html" target="_blank">
the handbook</a>, and more about structuring dataset at
<a href="https://psychoinformatics-de.github.io/rdm-course/02-structuring-data/index.html#example-structure-yoda-principles" target="_blank">
psychoinformatics-de.github.io/rdm-course/02-structuring-data</a></note>
</section>
<section data-markdown><script type="text/template">
![](../img/concepts/submodule_setup.svg)<!-- .element: height="500" -->
- Typical workflow in science
- Prior works (algorithm development, empirical data, etc.) are combined
to produce novel results with to goal of a publication
- **Aggregation across time and contributors**
- Aiming for (but often failing) to be reproducible
</script>
</section>
<section data-markdown>
## 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.
</section>
<section data-transition="None">
<h2>Why Modularity?</h2>
<ul>
<li>1. Reuse and access management</li>
<img src="../img/concepts/ukb_datasets.svg" height="500px">
</li>
<li class="fragment fade-in" data-fragment-index="1">2. Scalability</li>
<pre class="fragment fade-in" data-fragment-index="1"><code class="fragment fade-in" data-fragment-index="1">adina@bulk1 in /ds/hcp/super on git:master❱ datalad status --annex -r
15530572 annex'd files (77.9 TB recorded total size)
nothing to save, working tree clean</code></pre>
<small class="fragment fade-in" data-fragment-index="1"><a href="https://github.com/datalad-datasets/human-connectome-project-openaccess" target="_blank">(github.com/datalad-datasets/human-connectome-project-openaccess)</a></small>
</ul>
</section>
<section data-transition="None">
<h2>Why Modularity?</h2>
<ul>
<li>3. Transparency</li><br>
Original:
<pre><code class="sh" style="max-height:none" data-trim>
/dataset
├── sample1
│ └── a001.dat
├── sample2
│ └── a001.dat
...
</code></pre>
<div class="fragment">
Without modularity, after applied transform (preprocessing, analysis, ...):
<pre><code class="sh" style="max-height:none" data-trim>
/dataset
├── sample1
│ ├── ps34t.dat
│ └── a001.dat
├── sample2
│ ├── ps34t.dat
│ └── a001.dat
...
</code></pre>
Without expert/domain knowledge, no distinction between original and derived data
possible.
</div>
</ul>
</section>
<section data-transition="None">
<h2>Why Modularity?</h2>
<ul>
<li>3. Transparency</li><br>
Original:
<pre><code class="sh" style="max-height:none" data-trim>
/raw_dataset
├── sample1
│ └── a001.dat
├── sample2
│ └── a001.dat
...
</code></pre>
<strong>With modularity</strong> after applied transform (preprocessing, analysis, ...)
<pre><code class="sh" style="max-height:none" data-trim>
/derived_dataset
├── sample1
│ └── ps34t.dat
├── sample2
│ └── ps34t.dat
├── ...
└── inputs
└── raw
├── sample1
│ └── a001.dat
├── sample2
│ └── a001.dat
...
</code></pre>
Clearer separation of semantics, through use of pristine version of original dataset within a
<em>new, additional</em> dataset holding the outputs.</ul>
</section>
<section data-transition="None" data-markdown><script type="text/template">
## When to modularize?
- Target audience is different
- public vs. private
- domain specific vs. domain general
- Pace of evolution is different
- "factual" raw data vs. choices of (pre-)processing
- completed acquisition vs. ongoing study
- Size impacts I/O and logistics
- Git can struggle with 1M+ files
- filesystems (licensing) can struggle with large numbers of inodes
- More infos: [Go Big or Go Home chapter](http://handbook.datalad.org/en/latest/beyond_basics/basics-scaling.html)
- Legal/Access constraints
- personal vs. anonymized data
<aside class="notes">
Note to self
</aside>
</script>
</section>
<section data-transition="None">
<h2>P2: Record where you got it from, and where it is now</h2>
<img src="../img/concepts/data_origin.svg" height="300px">
<ul>
<li><strong>Link</strong> individual datasets to declare data-dependencies (e.g. as subdatasets).</li>
<li><strong>Record data's origin</strong> with appropriate commands, for example
to record access URLs for individual files obtained from (unstructured) sources "in the cloud".</li>
<li>Share and <strong>publish</strong> datasets for collaboration or back-up.</li>
</ul>
</section>
<section data-markdown>
## 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**
</section>
<section>
<h2>YODA Procedure</h2>
<code>datalad create</code> with the YODA configuration:
<pre><code>$ 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) </code></pre>
Outcome: Useful pre-structuring and configurations:
<pre><code>$ tree
.
├── CHANGELOG.md
├── code
│   └── README.md
└── README.md
</code></pre>
</section>
</section>
</div> <!-- /.slides -->
</div> <!-- /.reveal -->
<script src="../reveal.js/dist/reveal.js"></script>
<script src="../reveal.js/plugin/notes/notes.js"></script>
<script src="../reveal.js/plugin/markdown/markdown.js"></script>
<script src="../reveal.js/plugin/highlight/highlight.js"></script>
<script src="../custom/js/copy-code.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 1280,
height: 960,
// Factor of the display size that should remain empty around the content
margin: 0.1,
// Bounds for smallest/largest possible scale to apply to content
minScale: 0.2,
maxScale: 1.0,
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
});
</script>
<!-- A footer with a "1" and "home" button to get back to the first slide and the index page
<div id="hidden" style="display:none;">
<div id="header">
<div id="footer-left"><a href="#0">1️⃣</a></div>
<div id="footer-right"><a href="../workshops/2025-DKZ.2R.html">🏠</a></div>
</div>
</div> -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="../custom/js/headerandfooter.js"></script>
</body>
</html>