Print partial datasets.
Project description
print_partial_datasets
Command-line tool to scan a dataset organised in structured directories and print a table to highlight gaps. This is useful for spotting missing data or broken analyses. It relies on the wonderful fsl.utils.filetree tool from fslpy. For example:
Complete datasets
participant session raw_T1 raw_bold raw_fmap_mag raw_fmap_ph
───────────────────────────────────────────────────────────────────────────────
01 01 x x x x
───────────────────────────────────────────────────────────────────────────────
01 02 x x x x
───────────────────────────────────────────────────────────────────────────────
Partial datasets
participant session raw_T1 raw_bold raw_fmap_mag raw_fmap_ph
───────────────────────────────────────────────────────────────────────────────
04 02 x x x
───────────────────────────────────────────────────────────────────────────────
07 02 x x x
───────────────────────────────────────────────────────────────────────────────
10 02 x x x
───────────────────────────────────────────────────────────────────────────────
Installation
pip install print-partial-datasets
Usage
Specify your own file tree in a text file as shown in the fsl.utils.filetree documentation. This can be as simple as the example below. If your dataset is already organised in a structure such as BIDS, you may be able to use one of the preset trees:
sub-{participant}
ses-{session}
anat (anat_dir)
sub-{participant}_ses-{session}_T1w.nii.gz (anat_image)
sub-{participant}_ses-{session}_T1w_brain.nii.gz (brain_extracted)
dwi (dwi_dir)
sub-{participant}_ses-{session}_dwi.nii.gz (dwi_image)
You can either call the script from the command line, or programmatically from a python console or script.
Command line
print_partial_datasets -d /data/directory -f /path/to/file.tree -s anat_image brain_extracted dwi_image -v participant session
Python
Example python usage:
from print_partial_datasets import print_partial_datasets datadir = "/data/directory" filetree = "/path/to/file.tree" short_name = ["anat_image", "brain_extracted", "dwi_image"] variables = ["participant", "session"] print_partial_datasets(datadir, filetree, short_name, variables)
This should produce a nice printed summary of your data, with complete datasets followed by partial ones.
Free software: Apache Software License 2.0
Documentation: https://print-partial-datasets.readthedocs.io.
Credits
This is little more than a user-friendly wrapper around code written by Michiel Cottaar and Paul McCarthy.
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2021-03-17)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file print_partial_datasets-0.2.3.tar.gz.
File metadata
- Download URL: print_partial_datasets-0.2.3.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.59.0 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02436972318b64014bac9fb574965140eb144166cadf5816c6b65a38e7bb9414
|
|
| MD5 |
d4e530650fd782e1b4d56000e883e767
|
|
| BLAKE2b-256 |
0215f324cdf32dfa0231c884095e4e44373752af35babc1727f1ec1bde1c12a4
|
File details
Details for the file print_partial_datasets-0.2.3-py3.7.egg.
File metadata
- Download URL: print_partial_datasets-0.2.3-py3.7.egg
- Upload date:
- Size: 15.2 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.59.0 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab69854a04382ccde28b5d098bb1d74c9c8bdd5b4fa68a307f1163d5c33cada9
|
|
| MD5 |
4b19bc93b585d53ba49a15e42bc81730
|
|
| BLAKE2b-256 |
5d1b509e6b2b94859f2609a7b5faba344eb15269ffdb75c4ad3690c08825bd5d
|
File details
Details for the file print_partial_datasets-0.2.3-py2.py3-none-any.whl.
File metadata
- Download URL: print_partial_datasets-0.2.3-py2.py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.59.0 CPython/3.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81978bb22bdab90e43b2503285e932d8f09de5357dc1600a1964d5dd4606b473
|
|
| MD5 |
27385be9c36654039ccc8be3acc69552
|
|
| BLAKE2b-256 |
4736ea479355d793b6fae2b055642bd5bc5f2fa33eda5fdbc60198e6c11230f7
|