Skip to main content

BIDS integration into snakemake workflows

Project description

Snakebids

Tests Version Python versions DOI License: MIT

This repository implements the Snakebids builder function for Bids Paths. You can install this library as a stand-alone package via pip (see below), however, its contents are repackaged in the main snakebids repository.

Snakebids is a Python package that extends Snakemake, enabling users to create reproducible, scalable pipelines for processing neuroimaging data in the BIDS format. Snakebids workflows expose a CLI that conforms to the BIDS App guidelines.

Features

The bids() function is a flexible, unopinionated tool to build valid bids paths in a clean, pythonic syntax. It tries to support all the official bids tags, but allows any arbitrary custom tags as well. Entities are automatically ordered according to the bids spec.

Installation

Snakebids can be installed using pip:

pip install bids_path

Usage

To use, just import the bids() function:

from bids_path import bids

Note that bids() is just one piece of the broader snakebids. If snakebids is installed, bids() can be imported directly from the snakebids namespace:

from snakebids import bids

For detailed instructions and examples, please refer to the documentation.

Contributing

Snakebids is an open-source project, and contributions are welcome! If you have any bug reports, feature requests, or improvements, please submit them to the issues page.

To contribute, first clone the Github repository. bids_path dependencies are managed with Poetry (version 1.2 or higher). Please refer to the poetry website for installation instructions.

Note: bids_path makes use of Poetry's dynamic versioning. To see a version number on locally installed Snakebids versions, you will have to also install poetry-dynamic-versioning plugin to your poetry installation (`poetry self add "poetry-dynamic-versioning[plugin]"). This is not required for contribution.

Following installation of Poetry, the development can be set up by running the following commands:

poetry install
poetry run poe setup

bids_path uses poethepoet as a task runner. You can see what commands are available by running:

poetry run poe

Tests are done with pytest and can be run via:

poetry run poe test

Additionally, bids_path uses pre-commit hooks (installed via the poe setup command above) to lint and format code (we use black, isort and ruff). By default, these hooks are run on every commit. Please be sure they all pass before making a PR.

License

bids_path is distributed under the MIT License.

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

bids_path-0.0.1.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

bids_path-0.0.1-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

Supported by

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