Skip to main content

Creates a neuroimaging cohort by aggregating data across datasets.

Project description

Test pre-commit.ci status License https://github.com/psf/black Sourcery Documentation Status codecov

Cohort creator

TL;DR

Creates a neuroimaging cohort by aggregating data across datasets.

Command line tool to:

  • install a set of datalad datasets from openneuro,
  • get the data for a set of participants,
  • copy the data to a new directory structure to create a "cohort".

It takes 2 files as input that should list:

  • datasets to be included in the cohort
  • subject in each dataset to be included in the cohort

Both of those files can be generated by the neurobagel query tool.

For examples of of inputs TSV files see this page.

It outputs the cohort following the recommendations from the BIDS extension proposal 35.

Requirements

Operating system

It is recommended to use this package on a linux / Mac OS.

If you are on Windows, try using WSL (Windows Subsystem for Linux) to run this package: windows does not handle symbolic links well, and this package relies on symlinks. If you decided to go ahead anyway make sure you have got a LOT of disk space available.

More information here

Python dependencies

Make sure you have the following installed:

  • datalad and its dependencies:

    • if you are have anaconda / conda, it should be 'just' a matter of running

      conda install -c conda-forge datalad
      
    • But check the installation instructions for more details.

Other dependencies are listed in the pyproject.toml file.

Installation

git clone https://github.com/neurodatascience/cohort_creator.git
cd cohort_creator
pip install .

Limitations

Cohorts can only be created by aggregating data from openneuro and openneuro derivatives.

Latest datasets

Currently this should allow you to access more or less the following:

Number of datasets: 863 with 37441 subjects including:

  • 692 datasets with MRI data
  • with participants.tsv: 487
  • with phenotype directory: 22
  • with fmriprep: 90 (3937 subjects)
    • with participants.tsv: 74
    • with phenotype directory: 3
  • with freesurfer: 36 (3322 subjects)
    • with participants.tsv: 34
    • with phenotype directory: 2
  • with mriqc: 330 (14607 subjects)
    • with participants.tsv: 248
    • with phenotype directory: 18

It may be that very recent datasets are not available yet.

Dataset types

Only possible to get data from:

  • raw
  • mriqc
  • fmriprep

Not yet possible to get freesurfer data via the cohort creator, though the data is available in the sourcedata folder of the fmriprep datasets.

Blind spots

It may be possible that that some metadata files (JSON, TSV) are not accessed over correctly if they are not in the root of the dataset or the same folder as the data file.

FIX use pybids / ancpbids for data indexing and querying.

Demo

To get from openneuro-derivatives for all T1w

  • the MRIQC output for each file
  • the corresponding T1W file

run the following command from within the cohort_creator folder:

cohort_creator install \
  --dataset_listing inputs/datasets_with_mriqc.tsv \
  --participant_listing inputs/participants_with_mriqc.tsv \
  --output_dir outputs \
  --dataset_types raw mriqc \
  --verbosity 3

cohort_creator get \
  --dataset_listing inputs/datasets_with_mriqc.tsv \
  --participant_listing inputs/participants_with_mriqc.tsv \
  --output_dir outputs \
  --dataset_types raw mriqc \
  --verbosity 3

cohort_creator copy \
  --dataset_listing inputs/datasets_with_mriqc.tsv \
  --participant_listing inputs/participants_with_mriqc.tsv \
  --output_dir outputs \
  --dataset_types raw mriqc \
  --verbosity 3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cohort_creator-0.2.0.tar.gz (15.2 MB view details)

Uploaded Source

Built Distribution

cohort_creator-0.2.0-py3-none-any.whl (65.3 kB view details)

Uploaded Python 3

File details

Details for the file cohort_creator-0.2.0.tar.gz.

File metadata

  • Download URL: cohort_creator-0.2.0.tar.gz
  • Upload date:
  • Size: 15.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for cohort_creator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d7ac164048b21b1d869bf57d965b6cc473f6eb84ff5d098efa7fe6bd316138ff
MD5 69daa5f7a4b4bb78caa3763179dba16b
BLAKE2b-256 b41b3e5a3ab3438470ff8f8d1b181afd8eab4cecf1fbac28b6f9cadfb8d6353e

See more details on using hashes here.

File details

Details for the file cohort_creator-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cohort_creator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5673fd6aafb92d2c59bd9526d489ba068daa7d1f50ca4e12d2083a93514fc7ee
MD5 956d2d8109e3ccedcbc0bfee5ab5f6d0
BLAKE2b-256 0197f4e6158ce1158e3558f7039c2f80e614db44e649635343178cf6b3e7ccb7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page