Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use conda integrated package management within snakemake
Browse files Browse the repository at this point in the history
Dhananjhay committed Jan 8, 2025
1 parent e3a861d commit 97c919d
Showing 10 changed files with 884 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .dryrun_test_all.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/bin/bash
set -euxo pipefail
HIPPUNFOLD_CACHE_DIR=`pwd`/test_data/fake_models
hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w
hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --hemi R
hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --hemi L
hippunfold test_data/bids_multiT2w test_out participant -np --modality T2w
hippunfold test_data/bids_T1w test_out participant -np --modality T1w
hippunfold test_data/bids_hippb500 test_out participant -np --modality hippb500
hippunfold test_data/bids_T1w_longitudinal test_out participant -np --modality T1w
hippunfold test_data/bids_singleT2w_longitudinal test_out participant -np --modality T2w
hippunfold test_data/bids_manualseg test_out participant -np --modality manualseg --path_manualseg test_data/bids_manualseg/sub-{subject}_hemi-{hemi}_dseg.nii.gz
hippunfold test_data/bids_manualseg_1hemi test_out participant -np --modality manualseg --hemi L
hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --t1_reg_template
hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --output_space T1w
hippunfold test_data/bids_T1w test_out participant -np --modality T1w --use-template-seg
hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --use-conda
# hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --hemi R
# hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --hemi L
# hippunfold test_data/bids_multiT2w test_out participant -np --modality T2w
# hippunfold test_data/bids_T1w test_out participant -np --modality T1w
# hippunfold test_data/bids_hippb500 test_out participant -np --modality hippb500
# hippunfold test_data/bids_T1w_longitudinal test_out participant -np --modality T1w
# hippunfold test_data/bids_singleT2w_longitudinal test_out participant -np --modality T2w
# hippunfold test_data/bids_manualseg test_out participant -np --modality manualseg --path_manualseg test_data/bids_manualseg/sub-{subject}_hemi-{hemi}_dseg.nii.gz
# hippunfold test_data/bids_manualseg_1hemi test_out participant -np --modality manualseg --hemi L
# hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --t1_reg_template
# hippunfold test_data/bids_singleT2w test_out participant -np --modality T2w --output_space T1w
# hippunfold test_data/bids_T1w test_out participant -np --modality T1w --use-template-seg
8 changes: 8 additions & 0 deletions hippunfold/workflow/envs/env1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: env1
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- nibabel=5.2.1
- numpy=2.1.2
7 changes: 7 additions & 0 deletions hippunfold/workflow/envs/env2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: env2
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- connectome-workbench=2.0.1
9 changes: 9 additions & 0 deletions hippunfold/workflow/envs/env3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: env3
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- nibabel=5.2.1
- numpy=2.1.2
- scipy=1.13.1
7 changes: 7 additions & 0 deletions hippunfold/workflow/envs/env4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: env4
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- ants
131 changes: 131 additions & 0 deletions hippunfold/workflow/envs/envAll.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- annotated-types=0.7.0
- appdirs=1.4.4
- argparse-dataclass=2.0.0
- arrow=1.3.0
- astor=0.8.1
- astroid=2.15.8
- atomicwrites=1.4.1
- attrs=23.2.0
- bids-validator=1.14.6
- black=22.12.0
- boutiques=0.5.26
- certifi=2024.7.4
- charset-normalizer=3.3.2
- click=8.1.7
- colorama=0.4.6
- conda-inject=1.3.2
- configargparse=1.7
- connection-pool=0.0.3
- copier=9.3.1
- datrie=0.8.2
- dill=0.3.8
- docopt=0.6.2
- docutils=0.20.1
- dpath=2.2.0
- dunamai=1.22.0
- eval-type-backport=0.2.0
- fastjsonschema=2.20.0
- flake8=4.0.1
- formulaic=0.5.2
- funcy=2.0
- gitdb=4.0.11
- gitpython=3.1.43
- graphlib-backport=1.1.0
- greenlet=3.0.3
- humanfriendly=10.0
- idna=3.7
- immutables=0.21
- importlib-metadata=8.1.0
- importlib-resources=6.4.0
- iniconfig=2.0.0
- interface-meta=1.3.0
- isort=5.13.2
- jinja2=3.1.4
- jinja2-ansible-filters=1.3.2
- jinja2-time=0.2.0
- jsonschema=4.23.0
- jsonschema-specifications=2023.12.1
- jupyter-core=5.7.2
- lazy-loader=0.4
- lazy-object-proxy=1.10.0
- markupsafe=2.1.5
- mccabe=0.6.1
- more-itertools=9.1.0
- mypy-extensions=1.0.0
- nbformat=5.10.4
- nibabel=5.2.1
- num2words=0.5.13
- numpy=2.1.2
- packaging=23.2
- pandas=2.2.3
- pastel=0.2.1
- pathspec=0.12.1
- pkgutil-resolve-name=1.3.10
- plac=1.4.3
- platformdirs=4.2.2
- pluggy=1.5.0
- plumbum=1.9.0
- poethepoet=0.10.0
- prompt-toolkit=3.0.36
- psutil=6.0.0
- pulp=2.7.0
- pvandyken-deprecated=0.0.4
- py=1.11.0
- pybids=0.16.5
- pycodestyle=2.8.0
- pydantic=2.9.2
- pydantic-core=2.23.4
- pyflakes=2.4.0
- pygments=2.18.0
- pygraphviz=1.7
- pylint=2.17.7
- pyreadline3=3.4.1
- pytest=6.2.5
- pytest-console-scripts=1.4.1
- python-dateutil=2.9.0.post0
- pytz=2024.1
- pywin32=306
- pyyaml=6.0.1
- questionary=2.0.1
- referencing=0.35.1
- requests=2.32.3
- reretry=0.11.8
- rpds-py=0.19.0
- ruamel-yaml=0.18.6
- ruamel-yaml-clib=0.2.8
- scipy=1.13.1
- simplejson=3.19.2
- six=1.16.0
- smart-open=7.0.4
- smmap=5.0.1
- snakebids=0.13.1
- snakefmt=0.8.0
- snakemake=8.23.0
- snakemake-interface-common=1.17.4
- snakemake-interface-executor-plugins=9.3.2
- snakemake-interface-report-plugins=1.1.0
- snakemake-interface-storage-plugins=3.3.0
- sqlalchemy=2.0.31
- stopit=1.1.2
- tabulate=0.9.0
- termcolor=2.4.0
- throttler=1.2.2
- toml=0.10.2
- tomli=2.0.1
- tomlkit=0.13.0
- toposort=1.10
- traitlets=5.14.3
- types-python-dateutil=2.9.0.20240316
- typing-extensions=4.12.2
- tzdata=2024.1
- urllib3=2.2.2
- wcwidth=0.2.13
- wrapt=1.16.0
- yte=1.5.4
- zipp=3.19.2
name: env1
4 changes: 4 additions & 0 deletions hippunfold/workflow/rules/autotop.smk
Original file line number Diff line number Diff line change
@@ -66,6 +66,8 @@ rule laplace_coords_hipp:
hemi="{hemi}",
**inputs.subj_wildcards
),
conda:
"../envs/env1.yaml"
group:
"subj"
resources:
@@ -153,6 +155,8 @@ rule prep_equivolume_coords:
hemi="{hemi}",
**inputs.subj_wildcards
),
conda:
"../envs/env1.yaml"
log:
bids(
root="logs",
54 changes: 54 additions & 0 deletions hippunfold/workflow/rules/gifti.smk
Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@ rule cp_template_to_unfold:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -73,6 +75,8 @@ rule calc_unfold_template_coords:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
shadow:
"minimal" #this is required to use the temporary files defined as params
group:
@@ -124,6 +128,8 @@ rule constrain_surf_to_bbox:
label="{autotop}",
**inputs.subj_wildcards
),
conda:
"../envs/env1.yaml"
log:
bids(
root="logs",
@@ -190,6 +196,8 @@ rule warp_gii_unfold2corobl1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -230,6 +238,8 @@ rule correct_bad_vertices1:
label="hipp",
**inputs.subj_wildcards
),
conda:
"../envs/env3.yaml"
group:
"subj"
container:
@@ -266,6 +276,8 @@ rule calculate_surface_area1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -306,6 +318,8 @@ rule calculate_gyrification1:
label="hipp",
**inputs.subj_wildcards
),
conda:
"../envs/env2.yaml"
log:
bids(
root="logs",
@@ -354,6 +368,8 @@ rule calculate_curvature_from_surface1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -386,6 +402,8 @@ rule normalize_curvature1:
label="hipp",
**inputs.subj_wildcards
),
conda:
"../envs/env1.yaml"
group:
"subj"
container:
@@ -432,6 +450,8 @@ rule calculate_thickness_from_surface1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -486,6 +506,8 @@ rule metric_to_nii:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -568,6 +590,8 @@ rule unfolded_registration:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env4.yaml"
group:
"subj"
log:
@@ -636,6 +660,8 @@ rule warp_gii_unfoldreg:
label="hipp",
**inputs.subj_wildcards
),
conda:
"../envs/env1.yaml"
group:
"subj"
container:
@@ -743,6 +769,8 @@ rule warp_gii_unfold2corobl2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -781,6 +809,8 @@ rule correct_bad_vertices2:
label="{autotop}",
**inputs.subj_wildcards
),
conda:
"../envs/env3.yaml"
group:
"subj"
container:
@@ -857,6 +887,8 @@ rule affine_gii_to_native:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -889,6 +921,8 @@ rule calculate_surface_area2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -927,6 +961,8 @@ rule calculate_gyrification2:
label="{autotop}",
**inputs.subj_wildcards
),
conda:
"../envs/env2.yaml"
log:
bids(
root="logs",
@@ -972,6 +1008,8 @@ rule calculate_curvature_from_surface2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -1002,6 +1040,8 @@ rule normalize_curvature2:
label="{autotop}",
**inputs.subj_wildcards
),
conda:
"../envs/env1.yaml"
group:
"subj"
container:
@@ -1045,6 +1085,8 @@ rule calculate_thickness_from_surface2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -1080,6 +1122,8 @@ rule resample_atlas_to_refvol:
atlas="{atlas}",
**inputs.subj_wildcards
),
conda:
"../envs/env4.yaml"
log:
bids(
root="logs",
@@ -1134,6 +1178,8 @@ rule nii_to_label_gii:
atlas="{atlas}",
**inputs.subj_wildcards
),
conda:
"../envs/env2.yaml"
group:
"subj"
container:
@@ -1203,6 +1249,8 @@ rule create_dscalar_metric_cifti:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -1269,6 +1317,8 @@ rule create_dlabel_cifti_subfields:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -1478,6 +1528,8 @@ rule create_spec_file_dentate:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
@@ -1512,6 +1564,8 @@ rule merge_lr_spec_file:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
1 change: 1 addition & 0 deletions test_out/.snakebids
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mode": "bidsapp"}
650 changes: 650 additions & 0 deletions test_out/config/snakebids.yml

Large diffs are not rendered by default.

0 comments on commit 97c919d

Please sign in to comment.