Skip to content

Commit

Permalink
snakefmt formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
myousif9 committed Oct 28, 2022
1 parent dba39b9 commit 5603e83
Show file tree
Hide file tree
Showing 8 changed files with 394 additions and 323 deletions.
54 changes: 36 additions & 18 deletions anat_preproc/workflow/Snakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#---- begin snakebids boilerplate ----------------------------------------------
# ---- begin snakebids boilerplate ----------------------------------------------

import snakebids
from snakebids import bids
from os.path import join
import os

configfile: workflow.source_path('../config/snakebids.yml')

pybids_in = config['pybids_inputs']
configfile: workflow.source_path("../config/snakebids.yml")

if config['use_t2'] == False:
del pybids_in['t2w']

pybids_in = config["pybids_inputs"]

if config["use_t2"] == False:
del pybids_in["t2w"]

# Get input wildcards
inputs = snakebids.generate_inputs(
Expand All @@ -24,24 +26,40 @@ inputs = snakebids.generate_inputs(
use_bids_inputs=True,
)

#this adds constraints to the bids naming
wildcard_constraints: **snakebids.get_wildcard_constraints(config['pybids_inputs'])

#---- end snakebids boilerplate ------------------------------------------------
# this adds constraints to the bids naming
wildcard_constraints:
**snakebids.get_wildcard_constraints(config["pybids_inputs"]),


# ---- end snakebids boilerplate ------------------------------------------------

if config["grad_coef"] == False:

include: "rules/mprageise_mriqc.smk"


if config['grad_coef'] == False:
include: 'rules/mprageise_mriqc.smk'
else:
include: 'rules/gradcorrect_mprageise_mriqc.smk'

include: 'rules/mriqc_synthstrip_t1w.smk'
include: "rules/gradcorrect_mprageise_mriqc.smk"


include: "rules/mriqc_synthstrip_t1w.smk"

if config['use_t2']:
include: 'rules/synthstrip_t2w.smk'

include: 'rules/fmriprep_ciftify.smk'
if config["use_t2"]:

include: "rules/synthstrip_t2w.smk"


include: "rules/fmriprep_ciftify.smk"


if config["use_t2"]:

include: "rules/all_T2w.smk"


if config['use_t2']:
include: 'rules/all_T2w.smk'
else:
include: 'rules/all_noT2w.smk'

include: "rules/all_noT2w.smk"
24 changes: 12 additions & 12 deletions anat_preproc/workflow/rules/all_T2w.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,35 @@ rule all_skstrip:
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.synthstrip_t2w.output.t2w_skstrip,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['t2w']
**inputs.input_zip_lists["t2w"]
),
expand(
expand(
rules.mriqc.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.mriqc2.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
default_target: True


rule all:
input:
expand(
Expand All @@ -42,55 +43,54 @@ rule all:
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.synthstrip_t2w.output.t2w_skstrip,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['t2w']
**inputs.input_zip_lists["t2w"]
),
expand(
expand(
rules.reskstripT2w.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['t2w']
**inputs.input_zip_lists["t2w"]
),
expand(
expand(
rules.mriqc.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.mriqc2.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.fmriprep.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.ciftify_recon_all.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),

default_target: True
18 changes: 9 additions & 9 deletions anat_preproc/workflow/rules/all_noT2w.smk
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ rule all_skstrip:
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.mriqc.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.mriqc2.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
default_target: True


rule all:
input:
expand(
Expand All @@ -34,39 +35,38 @@ rule all:
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.mriqc.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.mriqc2.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.fmriprep.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),
expand(
expand(
rules.ciftify_recon_all.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
**inputs.input_zip_lists["uni"]
),

default_target: True
Loading

0 comments on commit 5603e83

Please sign in to comment.