Skip to content

Commit

Permalink
create isolated conda envs and integrate them with snakemake rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhananjhay committed Jan 10, 2025
1 parent e3a861d commit 0dbe1f9
Show file tree
Hide file tree
Showing 24 changed files with 277 additions and 0 deletions.
22 changes: 22 additions & 0 deletions hippunfold/workflow/envs/env1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: env1
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- batchgenerators
# - nnunet-inference-on-cpu-and-gpu = "1.6.6"
- numpy=1.21.2
- astropy>=4.0,<4.3.1
- pandas>=1.2.0,<1.3.0
- nibabel>=3.2.1
- scipy=1.7.1
- nilearn>=0.8.1
- seaborn>=0.11.2
- scikit-fmm>=2022.03.26
- simpleitk=2.0.2
- matplotlib=3.4.2
- pytorch=1.10.0
- pyvista>=0.44.2
- naturalneighbor>=0.2.1
- vtk
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
- convert3d
7 changes: 7 additions & 0 deletions hippunfold/workflow/envs/env3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: env3
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- connectome-workbench
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=2.5.4
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:
- khanlab
- defaults
dependencies:
- python=3.9
- greedyreg
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: env6
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- niftyreg
- convert3d
6 changes: 6 additions & 0 deletions hippunfold/workflow/envs/env8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: env8
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
4 changes: 4 additions & 0 deletions hippunfold/workflow/rules/autotop.smk
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ rule laplace_coords_hipp:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env1.yaml"
script:
get_cmd_laplace_coords()

Expand Down Expand Up @@ -165,6 +167,8 @@ rule prep_equivolume_coords:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env1.yaml"
script:
"../scripts/prep_equivolume_coords.py"

Expand Down
6 changes: 6 additions & 0 deletions hippunfold/workflow/rules/download.smk
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ rule import_template_dseg:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
shell:
"{params.copy_or_flip_cmd} {output.template_seg}"

Expand Down Expand Up @@ -120,6 +122,8 @@ rule import_template_coords:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
shell:
"{params.copy_or_flip_cmd} {output.template_coords}"

Expand Down Expand Up @@ -158,5 +162,7 @@ rule import_template_anat:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env2.yaml"
shell:
"{params.copy_or_flip_cmd} {output.template_anat}"
56 changes: 56 additions & 0 deletions hippunfold/workflow/rules/gifti.smk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rule cp_template_to_unfold:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -73,6 +75,8 @@ rule calc_unfold_template_coords:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
shadow:
"minimal" #this is required to use the temporary files defined as params
group:
Expand Down Expand Up @@ -138,6 +142,8 @@ rule constrain_surf_to_bbox:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env1.yaml"
script:
"../scripts/constrain_surf_to_bbox.py"

Expand Down Expand Up @@ -190,6 +196,8 @@ rule warp_gii_unfold2corobl1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -234,6 +242,8 @@ rule correct_bad_vertices1:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env1.yaml"
script:
"../scripts/fillbadvertices.py"

Expand Down Expand Up @@ -266,6 +276,8 @@ rule calculate_surface_area1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -319,6 +331,8 @@ rule calculate_gyrification1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -354,6 +368,8 @@ rule calculate_curvature_from_surface1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -390,6 +406,8 @@ rule normalize_curvature1:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env1.yaml"
script:
"../scripts/normalize_tanh.py"

Expand Down Expand Up @@ -432,6 +450,8 @@ rule calculate_thickness_from_surface1:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -486,6 +506,8 @@ rule metric_to_nii:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -568,6 +590,8 @@ rule unfolded_registration:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env4.yaml"
group:
"subj"
log:
Expand Down Expand Up @@ -640,6 +664,8 @@ rule warp_gii_unfoldreg:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env1.yaml"
script:
"../scripts/warp_flatsurf.py"

Expand Down Expand Up @@ -743,6 +769,8 @@ rule warp_gii_unfold2corobl2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -785,6 +813,8 @@ rule correct_bad_vertices2:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env1.yaml"
script:
"../scripts/fillbadvertices.py"

Expand Down Expand Up @@ -857,6 +887,8 @@ rule affine_gii_to_native:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -889,6 +921,8 @@ rule calculate_surface_area2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -939,6 +973,8 @@ rule calculate_gyrification2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -972,6 +1008,8 @@ rule calculate_curvature_from_surface2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -1006,6 +1044,8 @@ rule normalize_curvature2:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env1.yaml"
script:
"../scripts/normalize_tanh.py"

Expand Down Expand Up @@ -1045,6 +1085,8 @@ rule calculate_thickness_from_surface2:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -1092,6 +1134,8 @@ rule resample_atlas_to_refvol:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env4.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -1138,6 +1182,8 @@ rule nii_to_label_gii:
"subj"
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
shadow:
"minimal"
shell:
Expand Down Expand Up @@ -1203,6 +1249,8 @@ rule create_dscalar_metric_cifti:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -1269,6 +1317,8 @@ rule create_dlabel_cifti_subfields:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -1413,6 +1463,8 @@ rule create_spec_file_hipp:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -1478,6 +1530,8 @@ rule create_spec_file_dentate:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down Expand Up @@ -1512,6 +1566,8 @@ rule merge_lr_spec_file:
),
container:
config["singularity"]["autotop"]
conda:
"../envs/env3.yaml"
group:
"subj"
shell:
Expand Down
Loading

0 comments on commit 0dbe1f9

Please sign in to comment.