Skip to content

Commit

Permalink
create isolated conda env for each rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhananjhay committed Dec 19, 2024
1 parent 6895aa0 commit 1c98342
Show file tree
Hide file tree
Showing 27 changed files with 235 additions and 664 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 --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
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
9 changes: 9 additions & 0 deletions hippunfold/workflow/envs/env10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: env10
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- matplotlib
- pandas=2.2.3
- seaborn
7 changes: 7 additions & 0 deletions hippunfold/workflow/envs/env11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: env11
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- pandas=2.2.3
7 changes: 7 additions & 0 deletions hippunfold/workflow/envs/env12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: env12
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- greedyreg
9 changes: 9 additions & 0 deletions hippunfold/workflow/envs/env13.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: env13
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/env14.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: env14
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- niftyreg
10 changes: 10 additions & 0 deletions hippunfold/workflow/envs/env15.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: env15
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- nibabel=5.2.1
- numpy=2.1.2
- scipy=1.13.1
- naturalneighbor
7 changes: 7 additions & 0 deletions hippunfold/workflow/envs/env5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: env5
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- convert3d
7 changes: 7 additions & 0 deletions hippunfold/workflow/envs/env6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: env6
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- niftyreg
8 changes: 8 additions & 0 deletions hippunfold/workflow/envs/env7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: env7
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- convert3d
- niftyreg
8 changes: 8 additions & 0 deletions hippunfold/workflow/envs/env8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: env8
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- nilearn
- matplotlib
9 changes: 9 additions & 0 deletions hippunfold/workflow/envs/env9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: env9
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- nibabel=5.2.1
- numpy=2.1.2
- pandas=2.2.3
2 changes: 2 additions & 0 deletions hippunfold/workflow/rules/gifti.smk
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,8 @@ rule create_spec_file_hipp:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
group:
"subj"
shell:
Expand Down
6 changes: 6 additions & 0 deletions hippunfold/workflow/rules/myelin_map.smk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ rule divide_t1_by_t2:
suffix="T1wDividedByT2w.nii.gz",
**inputs.subj_wildcards
),
conda:
"../envs/env5.yaml"
group:
"subj"
container:
Expand Down Expand Up @@ -61,6 +63,8 @@ rule create_ribbon:
hemi="{hemi}",
**inputs.subj_wildcards
),
conda:
"../envs/env5.yaml"
group:
"subj"
container:
Expand Down Expand Up @@ -133,6 +137,8 @@ rule sample_myelin_map_surf:
label="{autotop}",
**inputs.subj_wildcards
),
conda:
"../envs/env2.yaml"
group:
"subj"
container:
Expand Down
6 changes: 6 additions & 0 deletions hippunfold/workflow/rules/nnunet.smk
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ rule unflip_nnunet_nii:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env5.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -282,6 +284,8 @@ rule qc_nnunet_f3d:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env6.yaml"
log:
bids(
root="logs",
Expand Down Expand Up @@ -331,6 +335,8 @@ rule qc_nnunet_dice:
caption="../report/nnunet_qc.rst",
category="Segmentation QC",
),
conda:
"../envs/env1.yaml"
group:
"subj"
container:
Expand Down
4 changes: 4 additions & 0 deletions hippunfold/workflow/rules/preproc_hippb500.smk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ rule resample_hippdwi_to_template:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env5.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -56,6 +58,8 @@ rule lr_flip_b500:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env5.yaml"
group:
"subj"
shell:
Expand Down
4 changes: 4 additions & 0 deletions hippunfold/workflow/rules/preproc_manualseg.smk
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ rule import_manualseg_to_corobl:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env4.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -48,6 +50,8 @@ rule lr_flip_seg:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env5.yaml"
group:
"subj"
shell:
Expand Down
6 changes: 6 additions & 0 deletions hippunfold/workflow/rules/preproc_t1.smk
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ else:
threads: 8
container:
config["singularity"]["autotop"]
conda:
"../envs/env4.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -97,6 +99,8 @@ rule warp_t1_to_corobl_crop:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env4.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -127,6 +131,8 @@ rule lr_flip_t1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env5.yaml"
group:
"subj"
shell:
Expand Down
14 changes: 14 additions & 0 deletions hippunfold/workflow/rules/preproc_t2.smk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ rule n4_t2:
threads: 8
container:
config["singularity"]["autotop"]
conda:
"../envs/env4.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -111,6 +113,8 @@ rule reg_t2_to_ref:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env7.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -179,6 +183,8 @@ else:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env5.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -242,6 +248,8 @@ rule reg_t2_to_t1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env7.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -345,6 +353,8 @@ rule compose_t2_xfm_corobl:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env5.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -407,6 +417,8 @@ rule warp_t2_to_corobl_crop:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env4.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -437,6 +449,8 @@ rule lr_flip_t2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env5.yaml"
group:
"subj"
shell:
Expand Down
12 changes: 12 additions & 0 deletions hippunfold/workflow/rules/qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ rule qc_reg_to_template:
caption="../report/t1w_template_regqc.rst",
category="Registration QC",
),
conda:
"../envs/env8.yaml"
group:
"subj"
container:
Expand Down Expand Up @@ -72,6 +74,8 @@ rule get_subfield_vols_subj:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env9.yaml"
script:
"../scripts/gen_volume_tsv.py"

Expand Down Expand Up @@ -105,6 +109,8 @@ rule plot_subj_subfields:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env10.yaml"
script:
"../scripts/plot_subj_subfields.py"

Expand Down Expand Up @@ -188,6 +194,8 @@ rule qc_subfield:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env8.yaml"
script:
"../scripts/vis_qc_dseg.py"

Expand Down Expand Up @@ -224,6 +232,8 @@ rule qc_subfield_surf:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env8.yaml"
script:
"../scripts/vis_qc_surf.py"

Expand Down Expand Up @@ -260,5 +270,7 @@ rule concat_subj_vols_tsv:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env11.yaml"
script:
"../scripts/concat_tsv.py"
Loading

0 comments on commit 1c98342

Please sign in to comment.