bagel 0.5.1.dev7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bagel/__init__.py +0 -0
- bagel/cli.py +520 -0
- bagel/dictionary_models.py +164 -0
- bagel/logger.py +63 -0
- bagel/mappings.py +102 -0
- bagel/models.py +97 -0
- bagel/pipeline-catalog/.git +1 -0
- bagel/pipeline-catalog/.pre-commit-config.yaml +16 -0
- bagel/pipeline-catalog/LICENSE +21 -0
- bagel/pipeline-catalog/README.md +2 -0
- bagel/pipeline-catalog/conversion/conversion.json +20 -0
- bagel/pipeline-catalog/processing/processing.json +36 -0
- bagel/utilities/__init__.py +0 -0
- bagel/utilities/bids_utils.py +74 -0
- bagel/utilities/derivative_utils.py +138 -0
- bagel/utilities/file_utils.py +96 -0
- bagel/utilities/model_utils.py +119 -0
- bagel/utilities/pheno_utils.py +590 -0
- bagel-0.5.1.dev7.dist-info/METADATA +146 -0
- bagel-0.5.1.dev7.dist-info/RECORD +23 -0
- bagel-0.5.1.dev7.dist-info/WHEEL +4 -0
- bagel-0.5.1.dev7.dist-info/entry_points.txt +2 -0
- bagel-0.5.1.dev7.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bagel
|
|
3
|
+
Version: 0.5.1.dev7
|
|
4
|
+
Summary: Automatic parsing of subjects' tabular data and imaging metadata into Neurobagel graph-compatible JSONLD files.
|
|
5
|
+
Author: Neurobagel Developers
|
|
6
|
+
Maintainer-email: Sebastian Urchs <sebastian.urchs@mcgill.ca>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2022 - Neurobagel Project, Origami Lab, McGill University.
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Classifier: Development Status :: 1 - Planning
|
|
30
|
+
Classifier: Intended Audience :: Science/Research
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
34
|
+
Requires-Python: >=3.10
|
|
35
|
+
Requires-Dist: httpx
|
|
36
|
+
Requires-Dist: isodate
|
|
37
|
+
Requires-Dist: jsonschema
|
|
38
|
+
Requires-Dist: pybids
|
|
39
|
+
Requires-Dist: pydantic<3,>=2
|
|
40
|
+
Requires-Dist: rich
|
|
41
|
+
Requires-Dist: typer
|
|
42
|
+
Provides-Extra: dev
|
|
43
|
+
Requires-Dist: coverage; extra == 'dev'
|
|
44
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
46
|
+
Provides-Extra: test
|
|
47
|
+
Requires-Dist: coverage; extra == 'test'
|
|
48
|
+
Requires-Dist: pytest; extra == 'test'
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
|
|
51
|
+
<div align="center">
|
|
52
|
+
|
|
53
|
+
# `bagel-cli`
|
|
54
|
+
|
|
55
|
+
[](https://github.com/neurobagel/bagel-cli/actions?query=branch:main)
|
|
56
|
+
[](https://github.com/neurobagel/bagel-cli/actions/workflows/test.yml)
|
|
57
|
+
[](https://app.codecov.io/gh/neurobagel/bagel-cli)
|
|
58
|
+
[](https://www.python.org)
|
|
59
|
+
[](LICENSE)
|
|
60
|
+
[](https://hub.docker.com/r/neurobagel/bagelcli/tags)
|
|
61
|
+
[](https://hub.docker.com/r/neurobagel/bagelcli/tags)
|
|
62
|
+
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
The `bagel-cli` is a Python command-line tool to automatically parse and describe subject phenotypic and imaging attributes in an annotated dataset for integration into the Neurobagel graph.
|
|
66
|
+
|
|
67
|
+
**Please refer to our [official Neurobagel documentation](https://neurobagel.org/user_guide/cli/) for information on how to install and use the CLI.**
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Development environment
|
|
71
|
+
|
|
72
|
+
To ensure that our Docker images are built in a predictable way,
|
|
73
|
+
we use `requirements.txt` as a lock-file.
|
|
74
|
+
That is, `requirements.txt` includes the entire dependency tree of our tool,
|
|
75
|
+
with pinned versions for every dependency (see [here](https://pip.pypa.io/en/latest/topics/repeatable-installs/#repeatability) for more information).
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Setting up a local development environment
|
|
79
|
+
To work on the CLI, we suggest that you create a development environment
|
|
80
|
+
that is as close as possible to the environment we run in production.
|
|
81
|
+
|
|
82
|
+
1. Install the dependencies from the lockfile (`dev_requirements.txt`):
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install -r dev_requirements.txt
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
2. Install the CLI without touching the dependencies:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pip install --no-deps -e .
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
3. Install the `bids-examples` and `neurobagel_examples` submodules needed to run the test suite:
|
|
95
|
+
```bash
|
|
96
|
+
git submodule init
|
|
97
|
+
git submodule update
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Confirm that everything works well by running the tests:
|
|
101
|
+
`pytest .`
|
|
102
|
+
|
|
103
|
+
### Setting up code formatting and linting (recommended)
|
|
104
|
+
|
|
105
|
+
[pre-commit](https://pre-commit.com/) is configured in the development environment for this repository, and can be set up to automatically run a number of code linters and formatters on any commit you make according to the consistent code style set for this project.
|
|
106
|
+
|
|
107
|
+
Run the following from the repository root to install the configured pre-commit "hooks" for your local clone of the repo:
|
|
108
|
+
```bash
|
|
109
|
+
pre-commit install
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
pre-commit will now run automatically whenever you run `git commit`.
|
|
113
|
+
|
|
114
|
+
### Updating Python lock-file
|
|
115
|
+
The `requirements.txt` file is automatically generated from the `setup.cfg`
|
|
116
|
+
constraints. To update it, we use `pip-compile` from the `pip-tools` package.
|
|
117
|
+
Here is how you can use these tools to update the `requirements.txt` file.
|
|
118
|
+
|
|
119
|
+
_Note: `pip-compile` will update dependencies based on the Python version of the environment it's running in._
|
|
120
|
+
|
|
121
|
+
1. Ensure `pip-tools` is installed:
|
|
122
|
+
```bash
|
|
123
|
+
pip install pip-tools
|
|
124
|
+
```
|
|
125
|
+
2. Update the runtime dependencies in `requirements.txt`:
|
|
126
|
+
```bash
|
|
127
|
+
pip-compile -o requirements.txt --upgrade
|
|
128
|
+
```
|
|
129
|
+
3. The above command only updates the runtime dependencies.
|
|
130
|
+
Now, update the developer dependencies in `dev_requirements.txt`:
|
|
131
|
+
```bash
|
|
132
|
+
pip-compile -o dev_requirements.txt --extra all --upgrade
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Regenerating the Neurobagel vocabulary file
|
|
136
|
+
Terms in the Neurobagel namespace (`nb` prefix) and their class relationships are serialized to a file
|
|
137
|
+
called [nb_vocab.ttl](https://github.com/neurobagel/recipes/blob/main/vocab/nb_vocab.ttl), which is automatically
|
|
138
|
+
uploaded to new Neurobagel graph deployments.
|
|
139
|
+
This vocabulary is used by Neurobagel APIs to fetch available attributes and attribute instances from a graph store.
|
|
140
|
+
|
|
141
|
+
When the Neurobagel graph data model is updated (e.g., if new classes or subclasses are created),
|
|
142
|
+
this file should be regenerated by running:
|
|
143
|
+
```bash
|
|
144
|
+
python helper_scripts/generate_nb_vocab_file.py
|
|
145
|
+
```
|
|
146
|
+
This will create a file called `nb_vocab.ttl` in the current working directory.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
bagel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
bagel/cli.py,sha256=WQR3NJabprup2Yg7qJ0o3JSuKtbAC4QJgvlBVH8Znm0,21261
|
|
3
|
+
bagel/dictionary_models.py,sha256=GSApzEumc4Fcl1Plzs9SeYpkUvpQ4Dnx-4_BBn0M6ek,5187
|
|
4
|
+
bagel/logger.py,sha256=2iU9ur2U9N1WYdY_uXmmNlRcCXzjCdhMHG9NZA4Zpag,1802
|
|
5
|
+
bagel/mappings.py,sha256=4Q41_d9iWDJGiutjN1BYr3SRQ1wmVcGq3I6VxCI_ObQ,3958
|
|
6
|
+
bagel/models.py,sha256=ElZ_fq5R-pi4y-hy00FXugrU4JLEYjN4Op0eU_ttvA0,2853
|
|
7
|
+
bagel/pipeline-catalog/.git,sha256=ljbGSvpo6tLFYK9Q2K7o21nQnU6utxlaPkY7v2zmUXY,44
|
|
8
|
+
bagel/pipeline-catalog/.pre-commit-config.yaml,sha256=I3_PdhvBr7l_U46o66_YsBv5sa21R_b7-oXfnOrdGuk,523
|
|
9
|
+
bagel/pipeline-catalog/LICENSE,sha256=XDykxn5eiv0OyprsB_dkBqTPPmAZHd1FuTGRV894N1Y,1085
|
|
10
|
+
bagel/pipeline-catalog/README.md,sha256=txi4QjKG0UXxukKr_HJFNAMQXemBIzkIevsWnjPqc_c,174
|
|
11
|
+
bagel/pipeline-catalog/conversion/conversion.json,sha256=HLJQxtCYdQSoxHXSZlZsFFGRMIin9utnjTzNX0Kj4-Q,304
|
|
12
|
+
bagel/pipeline-catalog/processing/processing.json,sha256=6BmUJk8_7kmXvwPmCsFJPd5pPb55dfbEwdFpM8RIa2Y,594
|
|
13
|
+
bagel/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
bagel/utilities/bids_utils.py,sha256=Rl4AN4YqnhaCN6HAkGV-vWW6KCf6n2MWDr0k7lJbCNc,2644
|
|
15
|
+
bagel/utilities/derivative_utils.py,sha256=_lR8MRXSHOboSIRSp9Hs767pFnGpcSDsv8nmnGowSBw,5658
|
|
16
|
+
bagel/utilities/file_utils.py,sha256=BoDW11Fryhmu886XZ78HD4aOVr49QWL_4Tg6a0hjWUI,3441
|
|
17
|
+
bagel/utilities/model_utils.py,sha256=mADHJaevY-T8txHepPfAdBoTNVyTJfKZoDhlXRYFShY,4515
|
|
18
|
+
bagel/utilities/pheno_utils.py,sha256=DYyrKictvpZiY_Vq58FHTjVNPTnpxpeRUAms0875NLY,24748
|
|
19
|
+
bagel-0.5.1.dev7.dist-info/METADATA,sha256=4GmACFhUVO53zPKlUZcukSbQ1UkVjpswfUZDgFfUT_A,7148
|
|
20
|
+
bagel-0.5.1.dev7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
21
|
+
bagel-0.5.1.dev7.dist-info/entry_points.txt,sha256=OcADLXneL70JYrrPdQ7fME6w2OGCJ0XHIptoMwQTBhs,42
|
|
22
|
+
bagel-0.5.1.dev7.dist-info/licenses/LICENSE,sha256=Ill2XchvRZmxRp6oPZ3yZl7HoQThxSQXaV931qDZ4wE,1129
|
|
23
|
+
bagel-0.5.1.dev7.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 - Neurobagel Project, Origami Lab, McGill University.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|