Skip to content

Commit

Permalink
Run snakefmt
Browse files Browse the repository at this point in the history
  • Loading branch information
pvandyken committed May 10, 2023
1 parent b0bd331 commit b057e73
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
3 changes: 1 addition & 2 deletions snakedwi/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ include: "rules/diffusion/sdc/synthsr.smk"
include: "rules/diffusion/eddy.smk"
include: "rules/diffusion/reg_dwi_to_t1.smk"
include: "rules/diffusion/bedpost.smk"

include: "rules/qc_app.smk"


# Currently unused
# include: rules/other.smk
# include: rules/templateflow.smk
Expand All @@ -44,7 +44,6 @@ if config["use_eddy_s2v"] and not config["use_eddy_gpu"]:
sys.exit(1)



rule all:
input:
**get_eddy_quad_all(),
Expand Down
1 change: 0 additions & 1 deletion snakedwi/workflow/rules/diffusion/reg_dwi_to_t1.smk
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ rule compile_qc_reg_dwi_t1_manifest:
)



rule convert_xfm_ras2itk:
input:
xfm_ras=rules.reg_dwi_to_t1.output.xfm_ras,
Expand Down
16 changes: 11 additions & 5 deletions snakedwi/workflow/rules/qc_app.smk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rule qc:
mask_qc=rules.compile_qc_b0_brainmask_manifest.output[0],
reg_qc=rules.compile_qc_reg_dwi_t1_manifest.output[0],
output:
os.path.join(qc, "data.json")
os.path.join(qc, "data.json"),
run:
with open(output[0], "w") as f:
json.dump(
Expand All @@ -14,19 +14,25 @@ rule qc:
f,
)


_qc_app = os.path.join(workflow.basedir, "..", "resources", "qc-app.tar.gz")


def _get_tar_contents(file):
try:
return [
p
for p in sp.check_output(["tar", "-tf", _qc_app]).decode().splitlines()
if p[-1] != '/'
if p[-1] != "/"
]
except sp.CalledProcessError as err:
raise Exception("Unable to find qc-app.tar.gz...") from err


rule unpack_qc_app:
input: os.path.join(workflow.basedir, "..", "resources", "qc-app.tar.gz")
output: _get_tar_contents(_qc_app)
input:
os.path.join(workflow.basedir, "..", "resources", "qc-app.tar.gz"),
output:
_get_tar_contents(_qc_app),
shell:
"tar -xvzf {input}"
"tar -xvzf {input}"

0 comments on commit b057e73

Please sign in to comment.