From a4ad1a16abd7a8bf204d76b89e172d12ae1e1389 Mon Sep 17 00:00:00 2001 From: Arya Massarat <23412689+aryarm@users.noreply.github.com> Date: Sat, 11 Sep 2021 08:55:14 -0700 Subject: [PATCH] remove threads directive from each rule. every thread should get a single core --- Snakefile | 10 ---------- config.yml | 8 -------- 2 files changed, 18 deletions(-) diff --git a/Snakefile b/Snakefile index b3eab9f..0254a48 100755 --- a/Snakefile +++ b/Snakefile @@ -112,7 +112,6 @@ rule stitch: files = directory(config['out']+"/{sample}/stitch"+("-lowQual" if check_config('low_qual_ortho', check_config('parallel')) else "")+"/stitched.files") conda: "envs/default.yml" benchmark: config['out']+"/{sample}/benchmark/stitch"+("-lowQual" if check_config('low_qual_ortho', check_config('parallel')) else "")+".tsv" - threads: config['cores'] shell: "scripts/stitch.py {params} {input} {output.project}" @@ -124,7 +123,6 @@ rule export_ortho: str(Path(rules.stitch.output.project).parents[0])+"/ortho.tiff" conda: "envs/default.yml" benchmark: config['out']+"/{sample}/benchmark/export_ortho.tsv" - threads: config['cores'] shell: "scripts/export_ortho.py {input} {output}" @@ -139,7 +137,6 @@ rule segment: low = config['out']+"/{sample}/segments/low/{image}.json" if check_config('parallel') else config['out']+"/{sample}/segments/low.json" conda: "envs/default.yml" benchmark: config['out']+"/{sample}/benchmark/segments/"+("{image}" if check_config('parallel') else "ortho")+".tsv" - threads: config['cores'] shell: "scripts/segment.py {params} {input} {output}" @@ -154,7 +151,6 @@ rule transform: confidence="(high|low)" conda: "envs/default.yml" benchmark: config['out']+"/{sample}/benchmark/transform/{confidence}-{image}.json" - threads: config['cores'] shell: "scripts/transform.py {input} {output}" @@ -192,7 +188,6 @@ rule watershed: segments = config['out']+"/{sample}/segments"+exp_str()+".json" conda: "envs/default.yml" benchmark: config['out']+"/{sample}/benchmark/watershed"+exp_str()+".tsv" - threads: config['cores'] shell: "scripts/watershed.py {input.ortho} {params.high_dir} {params.low_dir} {output.segments}" @@ -283,7 +278,6 @@ rule train: config['out']+"/{sample}/train"+exp_str()+"/model.rda", config['out']+"/{sample}/train"+exp_str()+"/variable_importance.tsv" conda: "envs/classify.yml" - threads: config['cores'] shell: "Rscript scripts/classify_train.R {input} {output}" @@ -327,7 +321,6 @@ rule classify: config['out']+"/{sample}/classify"+exp_str()+"/{image}.tsv" conda: "envs/classify.yml" benchmark: config['out']+"/{sample}/benchmark/classify"+exp_str()+"/{image}.tsv" - threads: config['cores'] shell: "Rscript scripts/classify_test.R {input} {output}" @@ -338,7 +331,6 @@ rule test: config['out']+"/{sample}/test"+exp_str()+"/classify/{image}.tsv" conda: "envs/classify.yml" benchmark: config['out']+"/{sample}/benchmark/test"+exp_str()+"/classify/{image}.tsv" - threads: config['cores'] shell: "Rscript scripts/classify_test.R {input} {output}" @@ -434,7 +426,6 @@ rule segments_map: config['out']+"/{sample}/segments-map"+exp_str()+".tiff" conda: "envs/default.yml" benchmark: config['out']+"/{sample}/benchmark/segments-map"+exp_str()+".tsv" - threads: config['cores'] shell: "scripts/map.py -l {input.img} {input.labels} {output}" @@ -448,7 +439,6 @@ rule map: config['out']+"/{sample}/map"+exp_str()+".tiff" conda: "envs/default.yml" benchmark: config['out']+"/{sample}/benchmark/map"+exp_str()+".tsv" - threads: config['cores'] shell: "scripts/map.py {input.img} {input.labels} {output} {input.predicts}" diff --git a/config.yml b/config.yml index aab4a89..4adba97 100644 --- a/config.yml +++ b/config.yml @@ -70,14 +70,6 @@ model: data/models/test-all-exp.rda # Defaults to 'out' if not provided out: out -# specifying the number of cores used to process each dataset -# TODO: note that this wouldn't work yet - we need to have parallel environments defined -# in purves first before we can use snakemake's multithread feature -# I just have it defined here so in the future if we have parallel environment -# we could use it -cores: 5 # The number of cores to use for this step - - # FOR THE RULE extract_images (only uncomment if using that rule) # specifying the list of segment labels that you want to extract the # source images for