Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule updates #24

Merged
merged 5 commits into from
Nov 16, 2022
Merged

Rule updates #24

merged 5 commits into from
Nov 16, 2022

Conversation

kaitj
Copy link
Collaborator

@kaitj kaitj commented Nov 13, 2022

Proposed changes

This PR pulls in and resolves conflicts from #17, #20, and #21. It also resolves previous review comments. Most of these include quality changes. Briefly (click drop toggle to see notes from previous PRs for respective workflows):

Freesurfer
  • Update to the thalamic segmentation output file name (which is defined by Freesurfer)
  • Uses wildcards to define some of the outputs
  • Addition of relevant references in the .smk file
Mrtpipelines
  • Updates to pybids_inputs
  • Use of variables instead of grabbing from config for every rule
  • Renamed rules to reflect similar naming of mrtrix functions
  • Update mrtrix container to 3.0.3.
zona_bb_subcortex
  • Defines the zona output directory
  • Changes for snakefmt
  • Fix name of files in resources for zona
  • Added anticipated path for anat segmentation for transformation purposes between different MNI spaces and subject native space
    1. These files are available locally at the moment, but are too big to be added to the git repo
  • Add transformation to rule to define an transform matrix

All rules have also been updated to make use of functools.partial.

An additional note - a couple of files needed for transformation is too large to be shared via this repository and after a brief discussion, look into downloading it as part of the container build / point users to download location. Need to discuss with @jclauneuro to see what best option is here (files are SNSX32 related, namely T1w and subcortical segmentations in MNI152NLin6Asym and MNI152Nlin2009b space)

Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionalitiy)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you are unsure about any of the choices, don't hesitate to ask!

  • Changes have been tested to ensure that fix is effective or that a feature works.
  • Changes pass the unit tests
  • Code has been run through the poe quality task
  • I have included necessary documentation or comments (as necessary)
  • Any dependent changes have been merged and published

Notes

All PRs will undergo the unit testing before being reviewed. You may be requested to explain or make additional changes before the PR is accepted.

@kaitj kaitj marked this pull request as ready for review November 13, 2022 23:08
This was linked to issues Nov 13, 2022
@kaitj kaitj self-assigned this Nov 13, 2022
@kaitj kaitj added the maintenance Updates or improvements that do not change functionality of the code label Nov 13, 2022
freesurfer.smk:
  - add exist_ok for Path.mkdir
  - fix duplicate input / out entries

zona_bb_subcortex.smk:
  - add exist_ok for Path.mkdir
  - syntax and piping fixes
  - remove unnecessary include:

mrtpipelines.smk:
  - add exist_ok for Path.mkdir
  - syntax and piping fixes
  - remove unnecessary include:
  - NOTE: Switch to new BidsInput (requires some refactoring; save for
later PR)

Snakefile:
  - add rule all
  - run snakefmt
@kaitj
Copy link
Collaborator Author

kaitj commented Nov 14, 2022

Syntaxes and workflow bugs have been fixed as of c5b4856. Also did a dry-run through the workflow to ensure it works (although labelmerge not added yet).

Copy link
Collaborator

@tkkuehn tkkuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of generally minor changes but I think this is very close to being ready to merge

dbsc/workflow/rules/zona_bb_subcortex.smk Outdated Show resolved Hide resolved
dbsc/config/snakebids.yml Outdated Show resolved Hide resolved
dbsc/run.py Show resolved Hide resolved
dbsc/workflow/rules/freesurfer.smk Show resolved Hide resolved
@kaitj kaitj requested a review from tkkuehn November 15, 2022 16:58
@kaitj kaitj force-pushed the smk-updates branch 2 times, most recently from 322ec1b to a346d43 Compare November 15, 2022 17:44
Copy link
Collaborator

@tkkuehn tkkuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nitpick and one small change

dbsc/run.py Outdated Show resolved Hide resolved
dbsc/workflow/rules/freesurfer.smk Outdated Show resolved Hide resolved
- Add shebang to run.py
- Use pathlib to get resource files (uses Path.parent instead of
workflow.basedir/../)
- Get rid of directory creation in freesurfer.smk
- Add CLI arg to pass in freesurfer directory location
- Update note regarding assumed preprocessing steps
- Remove space constraint on T1w image
@kaitj
Copy link
Collaborator Author

kaitj commented Nov 15, 2022

@tkkuehn Above changes should be fixed. I also found a few other workflow piping issues (namely incorrect use of wildcards in certain rules) that need to be corrected for when I was adding in resources and logs. Will throw that in a separate PR.

@kaitj kaitj requested a review from tkkuehn November 15, 2022 19:07
Copy link
Collaborator

@tkkuehn tkkuehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One tiny comment but this is otherwise good to merge, so I don't need to review it again after

dbsc/workflow/rules/freesurfer.smk Outdated Show resolved Hide resolved
@kaitj kaitj merged commit 5ea3a42 into main Nov 16, 2022
@kaitj kaitj deleted the smk-updates branch November 16, 2022 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Updates or improvements that do not change functionality of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mrtpipelines.smk zona_bb_subcortex.smk Review freesurfer.smk
2 participants