-
Notifications
You must be signed in to change notification settings - Fork 3
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
Mrtpipelines update #17
Conversation
- Add associated citation in comments - Renamed rules to match mrtrix function names - Updated mrtrix to latest release version - Updated pybids_inputs for diffusion - Updated names to more similarly match what was used in a different workflow (https://github.com/kaitj/mrtproc.git) - Updated notes to indicate whether TODO was for v0.1.x or v0.2.x - Define variables at top of .smk file to avoid grabbing from config for each rule - Fix remaining group directives that were missed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually tried running this yet, but a few comments from looking over the rules...
- Replace config['derivatives'] with config['bids_dir'] and update join - Change config to get to return None if flags not defined - Remove unnecessary lambda calls - Update params for passing shell and lmax variables to command - Simplify shell commands - Add missing ',' for tck2connectome - Update param for defining node labels in connectome2tck - Update naming of filtered files to be more BIDSesque
28fb0f9
to
9669f8a
Compare
- Redefined outputs to make use of wildcards to describe different tissue types - Kept responsemean call in one rule as the task it is performing is the same rather than split into separate rules - Consider using wildcards for tractograpy down the line
- Revert usage back to config["input_path"] - Set mrtrix_dir to make use of the output_dir rather than bids_dir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of things that I'm pretty sure will break the workflow, and some stylistic suggestions that you can take or leave depending on your preference. We should also put together some test data (even if just empty files) and make sure a dry-run of this completes before merging.
|
||
|
||
# ------------ MRTRIX PREPROC BEGIN ----------# | ||
rule nii2mif: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It strikes me now that this is another rule that could be split into two. Not a huge benefit, but would allow a bit more parallelization. Up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed we could split this into two. I just figured to keep the two things that are doing the same thing together - the parallelization wouldn't speed up the workflow too much anyways.
dbsc/workflow/rules/mrtpipelines.smk
Outdated
sfwm=expand(rules.estimate_response.output.sfwm, subject=config['subjects']), | ||
gm=expand(rules.estimate_response.output.gm, subject=config['subjects']), | ||
csf=expand(rules.estimate_response.output.csf, subject=config['subjects']) | ||
wm_rf=expand(rules.dwi2response.output.wm_rf, subject=config["subjects"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this before, but I would think this should be expanding over input_zip_lists
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was loosely based off of the workflow here: https://github.com/kaitj/mrtproc/blob/main/mrtproc/workflow/Snakefile
I'd probably hold off on making this change until we have a chance to test.
|
||
rule compute_tensor: | ||
|
||
rule dwi2tensor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another rule that could be split into two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes agreed, although again, not too much benefit and ultimately this could be an optional rule down the line (may not want tensor measures).
- Changes `use_bids_inputs=False` in config - Removed group analysis level in `snakebids.yml` - Added `desc` as a wildcard in `snakebids.yml` - Added missing '&&' in mrtpipelines.smk
- Make use of functools.partial to iterate over different wildcards rather than expand
I just went through and replaced any use of expand for the old outputs to make use of |
daf4b3c
to
5df79d5
Compare
- Fixes pattern for and expands over node1 and node2 - Snakefmt fixes
Proposed changes
A number of quality changes (primarily to
mrtpipelines.smk
) to try to bring this up-to-date as ofsnakebids==0.6.2
. Includes updates to:functools.partial
See the commit notes for full details.
Types of changes
What types of changes does your code introduce? Put an
x
in the boxes that applyChecklist
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!poe quality
taskNotes
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.