Metadata-Version: 2.3
Name: cohort_creator
Version: 0.3.0
Summary: Creates a neuroimaging cohort by aggregating data across datasets.
Project-URL: Bug trakcer, https://github.com/neurodatascience/cohort_creator/issues
Project-URL: Documentation, https://cohort-creator.readthedocs.io/en/latest/
Project-URL: Homepage, https://github.com/neurodatascience/cohort_creator
Author: Rémi Gau
Maintainer-email: Rémi Gau <remi.gau@gmail.com>
License: MIT
License-File: LICENSE
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Requires-Python: >=3.10
Requires-Dist: dash
Requires-Dist: dash-bootstrap-components
Requires-Dist: datalad
Requires-Dist: datalad-fuse
Requires-Dist: kaleido
Requires-Dist: matplotlib
Requires-Dist: mne
Requires-Dist: nibabel
Requires-Dist: pandas
Requires-Dist: plotly
Requires-Dist: pybids
Requires-Dist: pyyaml
Requires-Dist: requests
Requires-Dist: rich
Requires-Dist: rich-argparse
Provides-Extra: dev
Requires-Dist: cohort-creator[doc,test]; extra == 'dev'
Requires-Dist: gender-guesser; extra == 'dev'
Requires-Dist: pandas-stubs; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Provides-Extra: doc
Requires-Dist: furo; extra == 'doc'
Requires-Dist: myst-parser; extra == 'doc'
Requires-Dist: numpydoc; extra == 'doc'
Requires-Dist: sphinx; extra == 'doc'
Requires-Dist: sphinx-argparse; extra == 'doc'
Requires-Dist: sphinx-copybutton; extra == 'doc'
Provides-Extra: docs
Requires-Dist: cohort-creator[doc]; extra == 'docs'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Provides-Extra: tests
Requires-Dist: cohort-creator[test]; extra == 'tests'
Description-Content-Type: text/markdown

[![Test](https://github.com/neurodatascience/cohort_creator/actions/workflows/test.yml/badge.svg)](https://github.com/neurodatascience/cohort_creator/actions/workflows/test.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/neurodatascience/cohort_creator/main.svg)](https://results.pre-commit.ci/latest/github/neurodatascience/cohort_creator/main)
![License](https://img.shields.io/badge/license-MIT-blue.svg)
![https://github.com/psf/black](https://img.shields.io/badge/code%20style-black-000000.svg)
[![Sourcery](https://img.shields.io/badge/Sourcery-enabled-brightgreen)](https://sourcery.ai)
[![Documentation Status](https://readthedocs.org/projects/cohort-creator/badge/?version=latest)](https://cohort-creator.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/neurodatascience/cohort_creator/branch/main/graph/badge.svg?token=PMQYH0DIPX)](https://codecov.io/gh/neurodatascience/cohort_creator)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8313304.svg)](https://doi.org/10.5281/zenodo.8313304)
[![python versions](https://img.shields.io/pypi/pyversions/cohort_creator.svg)](https://pypi.org/project/cohort_creator/)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
# Cohort creator

> **TL;DR**
>
> Creates a neuroimaging cohort by aggregating data across datasets.

Command line tool to:

-   install a set of BIDS datalad datasets,
-   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](https://query.neurobagel.org/).

For examples of inputs TSV files see this [page](https://cohort-creator.readthedocs.io/en/latest/inputs.html).

It [outputs the cohort](<(https://cohort-creator.readthedocs.io/en/latest/outputs.html)>)
following the recommendations
from the [BIDS extension proposal 35](https://docs.google.com/document/d/1tFRNumQyIgjXBNC3brFDLO9FaikjL84noxK6Om-Ctik).

## 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](https://handbook.datalad.org/en/latest/intro/windows.html#ohnowindows)

### 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

        ```bash
        conda install -c conda-forge datalad
        ```

    -   But check the
        [installation instructions](https://handbook.datalad.org/en/latest/intro/installation.html#install)
        for more details.

Other dependencies are listed in the pyproject.toml file.

## Installation

```bash
pip install cohort_creator
```

### Installation from source

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

## Limitations

Cohorts can only be created by aggregating data from open BIDS datasets curated with datalad.

### 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. -->

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/michellewang"><img src="https://avatars.githubusercontent.com/u/29051929?v=4?s=100" width="100px;" alt="Michelle Wang"/><br /><sub><b>Michelle Wang</b></sub></a><br /><a href="https://github.com/neurodatascience/cohort_creator/issues?q=author%3Amichellewang" title="Bug reports">🐛</a> <a href="#ideas-michellewang" title="Ideas, Planning, & Feedback">🤔</a> <a href="#userTesting-michellewang" title="User Testing">📓</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://remi-gau.github.io/"><img src="https://avatars.githubusercontent.com/u/6961185?v=4?s=100" width="100px;" alt="Remi Gau"/><br /><sub><b>Remi Gau</b></sub></a><br /><a href="https://github.com/neurodatascience/cohort_creator/commits?author=Remi-Gau" title="Tests">⚠️</a> <a href="#maintenance-Remi-Gau" title="Maintenance">🚧</a> <a href="https://github.com/neurodatascience/cohort_creator/commits?author=Remi-Gau" title="Documentation">📖</a> <a href="https://github.com/neurodatascience/cohort_creator/issues?q=author%3ARemi-Gau" title="Bug reports">🐛</a> <a href="https://github.com/neurodatascience/cohort_creator/commits?author=Remi-Gau" title="Code">💻</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
