An Integrated and Trusted Scientific and Statistical Computing Core

Yaroslav O. Halchenko
@yarikoptic

Center for Open Neuroscience
Department of Psychological and Brain Sciences
Center for Cognitive Neuroscience
Dartmouth College
Live slides/Sources (git clone - add /.git): https://datasets.datalad.org/centerforopenneuroscience/talks/2022-nih-compcore/

Who am I?

Brief Bio

Born in Siberia (RSFSR, USSR), Grew up in Ukraine, Matured in U.S.A.

  • -1994 Physics Mathematics Gymnasium #17 (Ukraine):
    Regional&State Physics and Programming competitions. MS-DOS. Borland Pascal
  • -1999 VSTU (Ukraine): Masters in Opto-Electronic Engineering
    (@yarikoptic). State Physics and International ACM Programming competitions. Spine diagnostic apparatus. Member of "Small Academy of Science of Ukraine". SPIE. Soros Fellowship (twice). MS-DOS/Windows. Borland Pascal, Delphi, VBA
  • -2003 University of New Mexico: Masters in Computer Science
    B.Pearlmutter. SOBI/JADE ICA for single trial MEG. Favorite course: Data structures and algorithms. Debian GNU/Linux. C, Matlab, shell. CVS
  • -2009 Rutgers-Newark/NJIT: Ph.D. in Computer Science
    S.Hanson. fMRI decoding (RFE SVM). RUMBA. HPC sysadmin (cfengine, PBS). M.Hanke. Debian pkg-exppsy (for FSL and PyEPL). Official Debian developer. fMRI/EEG (TRANS)fusion. PyMVPA. C++, Python. SVN, GIT. 1 wife, 3 kids
  • - NOW Dartmouth College, PBS Department:
    Postdoc, Scientist, Research Assistant/Associate Professor

    J.Haxby. PyMVPA (Hyperalignment, ...), NeuroDebian, DataLad, ReproNim, DANDI, ... Chicken Coop, ... CON:

Integration & Trust Tiers

  • Social
  • Data acquisition
  • Methods/Analytics
  • Software systems
  • Data management
  • Services

Trust is largely a social aspect

How do we convince ourselves (and others) that our data/software/results are correct?

Hint: statistics is just a part of an answer

How do we convince ourselves?

We share accountability with

  • 3rd-party: recursive definition
    (hardware and software)
  • data collection/QA team
  • in-house developers&administrators team
  • analytic/scientists team

How can we minimize unexplained variance?

Noise ⊆ Unexplained variance

  • minimize human repetitive/boring IO == maximize human efficiency:
    • automate data collection/harmonization - minimize human factor
    • strive to collect more auxiliary (meta)data - might be "the variance"
    • standardize processing pipelines - minimize parametrization
    • provide efficient overviews/summaries - avoid "black box"
  • encourage (and automate) simulations: software/data testing
  • encourage (and code-in) assertions: assumptions checking
  • facilitate peer-review: by team not only reviewers
  • facilitate provenance/accountability tracking
  • facilitate re-use: user testing
  • avoid blind trust the 3rd party
  • to deliver to humans: provide high-level guidelines

3rd party?


Unknown artist/origin, borrowed from
http://blogs.quovantis.com/god-programmer/


Reality: Most of the data is DERIVED data!

Including the one from ...

Nuisance study: Conclusion on Phatom data

Variance in SNR through time in phantom QA data can very well (R2=0.53) be explained by intrinsic factors

Cheng CP and Halchenko YO. A new virtue of phantom MRI data: explaining variance in human participant data [version 1]. F1000Research 2020, 9:1131 https://doi.org/10.12688/f1000research.24544.1
http://datasets.datalad.org/centerforopenneuroscience/nuisance/presentations/2020-NNL/ contains a more detailed presentation

Nuisance study: Hypothesis confirmed

A proxy measure of MRI scanner health, such as SNR from phantom data, can explain some variance in human data results

Cheng CP and Halchenko YO. A new virtue of phantom MRI data: explaining variance in human participant data [version 1]. F1000Research 2020, 9:1131 https://doi.org/10.12688/f1000research.24544.1
http://datasets.datalad.org/centerforopenneuroscience/nuisance/presentations/2020-NNL/ contains a more detailed presentation

Example 5-step guidelines from P41 ReproNim

Reproducible by Design

Challenge: Human data re-use requires permission to share!


open-brain-consent.readthedocs.io

Born in 2014

E. Bannier, G. Barker, V. Borghesani, N. Broeckx, P. Clement, K. E. Emblem, S. Ghosh, E. Glerean, K. J. Gorgolewski, M. Havu, Y. O. Halchenko, P. Herholz, A. Hespel, S. Heunis, Y. Hu, C.-P. Hu, D. Huijser, M. I. Vayá, R. Jancalek, V. K. Katsaros, M.-L. Kieseler, C. Maumet, C. A. Moreau, H.-J. Mutsaerts, R. Oostenveld, E. Ozturk-Isik, N. P. L. Espinosa, J. Pellman, C. R. Pernet, F. B. Pizzini, A. Š. Trbalić, P.-J. Toussaint, M. V. di Oleggio Castello, F. Wang, C. Wang, and H. Zhu. The Open Brain Consent: Informing research participants and obtaining consent to share brain imaging data. Human Brain Mapping, feb 2021. doi: 10.1002/hbm.25351

Federally regulated but locally “managed”

Outcomes

Challenge: how to minimize human IO necessary to "understand" data?

Answer: Standardize!


Gorgolewski, K. J., Auer, T., Calhoun, V. D., Craddock, R. C., Das, S., Duff, E. P., Flandin, G., Ghosh, S. S., Glatard, T., Halchenko, Y. O., Handwerker, D. A., Hanke, M., Keator, D., Li, X., Michael, Z., Maumet, C., Nichols, B. N., Nichols, T. E., Pellman, J., Poline, J.-B., Rokem, A., Schaefer, G., Sochat, V., Triplett, W., Turner, J. A., Varoquaux, G., and Poldrack, R. A. (2016). The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Scientific Data, 3:160044

Benefits from datasets standardization into BIDS

  • You have seen one BIDS dataset -- you have seen them all!
  • BIDS is both human- and machine- friendly
    • From 1.7.0 WiP to make BIDS specification itself machine readable!
    • That would avoid necessity for hard-coding BIDS in client software
  • BIDS compliance could be automatically verified using bids-validator BIDS-App
  • BIDS-apps (such as mriqc, fmriprep, etc) provide a turnkey solution for BIDS datasets
  • PyBIDS, matlab-bids, etc. can assist scripting use of BIDS datasets
  • ... many more benefits ...
  • Everyone in neuroimaging should be encouraged to collect/operate on data in BIDS format!
  • NIH intramural program would benefit from participation and even steering in the development of community-driven standards

Challenge: conversion of data into BIDS could be painful

ReproIn


reproin.repronim.org

Born in 2016

ReproIn: BIDS at the scanner

ReproIn: automatically converted into BIDS using HeuDiConv

ReproIn: Benefits

  • Minimal single time investment of adhering to sequence naming convention
    • convert at will
    • catch/fix problems with acquisition early (bids-validator!)
      (no more "Half of my subjects lack X%-of-the-data")
  • All datasets within center can be organized into a hierarchy reflecting
    hierarchy at the scanner console
    (no more "Where that long gone RA buried original data?")
  • Sidecar .json files in BIDS contain useful DICOM fields
    (no more of "I've lost the post-it with slice order")
  • DICOM files are retained under sourcedata/
    (easy to re-convert if needed)
  • Optionally DataLad can be used to provide extra benefits

Such reduction in human entry and data manipulation
through automation and early validation increases trust
in correctness of raw neuroimaging data!

Beyond ReproIn

  • ReproStim (prototype deployed at DBIC):
    automate recording of ALL audio-video stimuli as presented to participants:
    • transparent to experimenter audio/video grabber
    • will automatically "slice" recordings into BIDS datasets
    • near exact re-executability of any audio/video stimuli
    • imagine all of your neuroimaging data usable for forward modeling/AI
    • already helped to recover randomization order for a session
  • ReproEvents (WiP): automate collection of events
    • transparent to experimenter USB grabber
    • automatically populate BIDS _events.tsv files
    • accompany with support in stimuli software (PsychoPy, PTB-3)
      to provide synchronization cues and HED tags
  • con/noisseur (Concept): automate verification of entered/displayed information

Automated (comes for free, trusted more) collection of auxiliary
data types to make collected data more useful for others to re-use.

More on automation of data collection in webinar
"Reproducible Execution of Data Collection/Processing".
Slides and Video accessible from https://www.repronim.org/webinar-series.html

Challenge 2007: No standard versatile framework for analysis of neuroimaging data using Machine Learning methodologies

Secret Sauce: no code == no reproducibility == little trust




Born in 2007 M. Hanke, Y. O. Halchenko, P. B. Sederberg, S. J. Hanson, J. V. Haxby, and S. Pollmann. PyMVPA: A Python toolbox for multivariate pattern analysis of fMRI data. Neuroinformatics, 7:37–53, 2009a. doi: 10.1007/s12021-008-9041-y

PyMVPA Features

Applicable across different modalities

M. Hanke†, Y. O. Halchenko† , P. B. Sederberg, E. Olivetti, I. Fründ, J. W. Rieger, C. S. Herrmann, J. V. Haxby, S. J. Hanson, and S. Pollmann. PyMVPA: A unifying approach to the analysis of neuroscientific data. Frontiers in Neuroinformatics, 3:3, 2009b. doi: 10.3389/neuro.11.003.2009

And even for integrating across modalities

TRANSFusion: EEG fMRI mapping

And others could take advantage of it:

Overall:

  • Integration across methodologies, software implementations, and data modalities
  • Guarded users against double-dipping regardless of the model complexity
  • Very extensive unit-, example- and documentation testing improved our and user trust in obtained results
  • Traveling trainer workshops (akin to AFNI schools) facilitated training, adoption, and thus "user-testing"
  • Integration and re-use (instead of re-implementation) of external functionality
    • made PyMVPA project feasible on a "low-budget" of two Ph.D. students
    • benefited upstream (nibabel, MDP, scikit-learn, scipy, etc) projects
    • adoption of OpenfMRI layout (precursor to BIDS) - generalizable analysis pipelines

It is efficient to offload modality/methodology specifics to existing solutions, and powered by standards establish a reusable automated (minimal user input) and trustworthy analysis pipelines.

PyMVPA brought a challenge: Deployment

"... The PyMVPA manual has a picture of a dude performing pattern-classification on fMRI data with his freaking cellphone. Awesome. If you can do it on a cellphone, then I'm set".

I have a computer (MAC).
Hours later, I'm wrestling with MAC OS (Leopard) ...



Born in 2009
Y. O. Halchenko† and M. Hanke†. Open is not enough. let’s take the next step: An integrated, community-driven computing platform for neuroscience. Frontiers in Neuroinformatics, 6(00022), 2012. doi: 10.3389/fn-inf.2012.00022

Solution to system integration challenge:

More detail on why and how:


Halchenko, Y. O. and Hanke, M. (2012). Open is not enough. Let’s take the next step: An integrated, community-driven computing platform for neuroscience. Frontiers in Neuroinformatics, 6(00022). PMC3458431

NeuroDebian from user perspective:

Under-the-hood for PyMVPA user:

Under-the-hood for a NeuroDebian developer:

Overall:

Integration of software projects within a distribution

  • greatly reduced user&developer burden in software installations/maintenance
  • improved trust in correct operation
  • prepared projects for inclusion in other distributions (e.g., Conda-Forge, Fedora, Gentoo) and/or offloading maintenance to other teams (such as Debian-Med)
  • allowed to benefit from a huge community of open source software enthusiasts and experts
  • helped to ensure adherence to legal norms
  • facilitated collaboration, archival, experimentation, and reproducibility
  • Seek inclusion of your developed software into FOSS Distributions to maximize benefits and share burden and accountability
  • Containerization then "comes for free"

But it revealed a shortcoming:

Software platforms are not designed for managing data!

  • modularity is not as clearly defined
    (interest could be in specific group of files, videos-vs-images or humans-vs-objects, etc)
  • data is less volatile (lesser versions, only a few files change)
  • tarballs are inefficient
  • we cannot host copies of all data
  • cacophony of authentication schemes, interfaces, protocols
  • difficulty to share new or derived data

A data management suite that makes data access and management as easy as managing code and software!



Born in 2013 Y. Halchenko, K. Meyer, B. Poldrack, D. Solanky, A. Wagner, J. Gors, D. MacFarlane, D. Pustina, V. Sochat, S. Ghosh, C. Mönch, C. Markiewicz, L. Waite, I. Shlyakhter, A. de la Vega, S. Hayashi, C. Häusler, J.-B. Poline, T. Kadelka, K. Skytén, D. Jarecka, D. Kennedy, T. Strauss, M. Cieslak, P. Vavra, H.-I. Ioanas, R. Schneider, M. Pflüger, J. Haxby, S. Eickhoff, and M. Hanke. DataLad: distributed system for joint management of code, data, and their relationship. Journal of Open Source Software, 6(63):3262, jul 2021. doi: 10.21105/joss.03262

DataLad in one figure

Meet one of the "largest" Git "repositories"

over 6,000 Git repositories as "subdatasets",
with access to almost 500TB of neural data

github.com/myyoda/myyoda


Data provenance capture

Provenance capture

  • Computational provenance: Datasets can track software containers (see datalad-container), and perform and record computations inside it:
  • $ datalad containers-run -n neuroimaging-container \
      --input 'mri/*_bold.nii --output 'sub-*/LC_timeseries_run-*.csv' \
      "bash -c 'for sub in sub-*; do for run in run-1 ... run-8;
         do python3 code/extract_lc_timeseries.py \$sub \$run; done; done'"
    
    -- Git commit -- Michael Hanke < ... @gmail.com>; Fri Jul 6 11:02:28 2019
        [DATALAD RUNCMD] singularity exec --bind {pwd} .datalad/e...
        === Do not change lines below ===
        {
         "cmd": "singularity exec --bind {pwd} .datalad/environments/nilearn.simg bash..",
         "dsid": "92ea1faa-632a-11e8-af29-a0369f7c647e",
         "inputs": [
          "mri/*.bold.nii.gz",
          ".datalad/environments/nilearn.simg"
         ],
         "outputs": ["sub-*/LC_timeseries_run-*.csv"],
         ...
        }
        ^^^ Do not change lines above ^^^
    ---
     sub-01/LC_timeseries_run-1.csv | 1 +
    ...

Provenance capture

  • All recorded transformations can be re-computed automatically
  • $ datalad rerun eee1356bb7e8f921174e404c6df6aadcc1f158f0
    [INFO] == Command start (output follows) =====
    [INFO] == Command exit (modification check follows) =====
    add(ok): sub-01/LC_timeseries_run-1.csv (file)
    ...
    save(ok): . (dataset)
    action summary:
      add (ok: 45)
      save (notneeded: 45, ok: 1)
      unlock (notneeded: 45)
    ...
    • Aid with the reproducibility of a result and verify it (via content hash)
    • Use complete capture and automatic re-computation as alternative to storage and transport

Extend DataLad

Besides DataLad "core", there are extensions:

  • Separate Python packages, anybody can develop their own
  • Support for tailored solutions
  • Can provide additional commands, procedures, metadata extractors, ...
  • Available extensions
    • containers: support for containerized computational environments
    • crawler: track web resources in automated data distributions
    • neuroimaging: neuroimaging research data and workflow
    • fuse: use FSSPEC to provide sparse on-demand access to data and
      FUSE filesystem (on GNU/Linux)
    • osf: interface with the Open Science Framework
    • ukbiobank: work with the UKbiobank data
    • xnat: alternative to crawler to track XNAT projects

http://handbook.datalad.org/en/latest/extension_pkgs.html - canonical list in handbook http://docs.datalad.org/en/latest/customization.html#extension-packages - devel docs
https://github.com/datalad/datalad-extensions/ - health status

DataLad for users

  • minimized tedious human IO to obtain data
  • harmonized management of all human digital artifacts/data
  • facilitated modularity, integration and re-use
  • provided guarantees of data integrity
  • facilitated verification of data availability
  • enabled collection of annotated and re-executable provenance
  • gave an awesome good night read: handbook.datalad.org
  • hours of audio/video enrichment: youtube.com/c/datalad
  • ... collaboration, etc ...

DataLad for its developers:

  • Layering of technologies:
    • Base technologies: git, ssh, rsync, rsync, rclone, ...
    • Data logistics: git-annex
    • Core product: DataLad
    • Downstream projects: DataLad extensions, OpenNeuro, CONP, ...
  • Cacophony of deployment scenarios:
    • OSes: GNU/Linux, OS X, Windows
    • Filesystems: "OS default", network (NFS), HPC (Lustre), ...

How can we trust our work, stay sane, and not get lost?

PART of an ANSWER: AUTOMATION

DataLad: all changes are tested

DataLad extensions are tested against DataLad daily!

git-annex is built and tested (against DataLad) daily!

con/tinuous archives all the logs and builds

In DataLad We Trust!

And so do they:

M. Hanke, F. Pestilli, A. S. Wagner, C. J. Markiewicz, J.-B. Poline, and Y. O. Halchenko. In defense of decentralized research data management. Neuroforum, 0(0), jan 2021. doi: 10.1515/nf-2020-0037

Challenge: Develop a BRAIN Initiative Archive



borrowed from socialsciencespace.com


Born in 2019

An Archive and Collaboration Space for Neurophysiology Projects

What data is in DANDI

DANDI Services and integrations

DANDI Standards

M.-H. Bourget, L. Kamentsky, S. S. Ghosh, G. Mazzamuto, A. Lazari, C. J. Markiewicz, R. Oostenveld, G. Niso, Y. O. Halchenko, I. Lipp, S. Takerkart, P.-J. Toussaint, A. R. Khan, G. Nilsonne, F. M. Castelli, T. B. M. , J. Cohen-Adad, S. Appelhoff, R. Blair, E. Earl, F. Feingold, A. Galassi, R. Gau, C. J. Markiewicz, and T. Salo. Microscopy-BIDS: An extension to the brain imaging data structure for microscopy data. Frontiers in Neuroscience, 16, 2022. doi: 10.3389/fnins.2022.871228

DANDI Metadata schema

How do we ensure correct operation?

Collaborate and automate!

  • Delegate data validation to standards
    • work with standards developers/communities
  • Impose additional requirements through harmonized schema
  • Unit- and integration- test software components
    • an entire archive can be instantiated on any machine with docker-compose
  • Dandisets are converted/updated into DataLad datasets and pushed to GitHub
    • data resides on S3 (and some institutional backups)
  • Releases and deployment of the components are automated on GitHub

Webshots of all dandisets for timing and smoke testing

Trivia: this setup was used to quickly troubleshoot OHBM 2021 online conference deficiencies

Overall

  • Input from the users/community should drive the standards,
    not the other way around
  • Standards can and should be improved to accommodate
    new data types and account for new scales of data
  • Ability to deploy an entire complex infrastructure
    enables testing and safe experimentation
  • Seems obvious? Check other archives...

see the SSCR

Integrated and Trusted:

  • minimizing tedious human labor and leaving more time for fun research
  • striving to automate and enrich data collection for the studies
  • establishing a mantra of "Better Science by Design"
  • placing the Study design 1st and Standards 2nd in the guidelines to research groups
  • collaborate with other intramural teams and researchers
  • growing expertise in other data modalities as driven by demand
  • striving to improve data re-use and reproducibility
  • promoting and educating researchers in contemporary data management solutions
  • working with the community to provide turnkey computing pipelines
  • working with data standards to ensure that needs of intramural researchers are met
  • continuing the excellent history of training established by AFNI group
  • participating in ReproNim's "train the trainer" concept
  • facilitating diversity and inclusion

Thank you!