Skip to main content
added 41 characters in body
Source Link
zhanxw
  • 213
  • 2
  • 6

My goal is to process two samples, S1 and S2, using two rules, step1, step2. The Snakemake file is like:

samplesSAMPLES = ['S1', 'S2'] 

rule all:
  input: "S1expand("{sample}.done", "S2.done"sample = SAMPLES)

rule step1:
  input: "{sample}"
  output: "{sample}.step1.donedone"
  shell: "touch {output}" 

rule step2:
  input: "{sample}.step1.donedone"
  output: "{sample}.donedone"
  shell: "touch {output}"

The current execution order is:

step1 on S1
step1 on S2
step2 on S1
step2 on S2

Is there a way to change the order to:

step1 on S1
step2 on S1
step1 on S2
step2 on S2

Basically, I want to complete S1, then S2. Is there a way to specify the order of executions in Snakemake?

My goal is to process two samples, S1 and S2, using two rules, step1, step2. The Snakemake file is like:

samples = ['S1', 'S2']
rule all:
  input: "S1.done", "S2.done"

rule step1:
  input: {sample}
  output: {sample}.step1.done
  shell: "touch {output}"
rule step2:
  input: {sample}.step1.done
  output: {sample}.done
  shell: "touch {output}"

The current execution order is:

step1 on S1
step1 on S2
step2 on S1
step2 on S2

Is there a way to change the order to:

step1 on S1
step2 on S1
step1 on S2
step2 on S2

Basically, I want to complete S1, then S2. Is there a way to specify the order of executions in Snakemake?

My goal is to process two samples, S1 and S2, using two rules, step1, step2. The Snakemake file is like:

SAMPLES = ['S1', 'S2'] 

rule all:
  input: expand("{sample}.done", sample = SAMPLES)

rule step1:
  input: "{sample}"
  output: "{sample}.step1.done"
  shell: "touch {output}" 

rule step2:
  input: "{sample}.step1.done"
  output: "{sample}.done"
  shell: "touch {output}"

The current execution order is:

step1 on S1
step1 on S2
step2 on S1
step2 on S2

Is there a way to change the order to:

step1 on S1
step2 on S1
step1 on S2
step2 on S2

Basically, I want to complete S1, then S2. Is there a way to specify the order of executions in Snakemake?

Source Link
zhanxw
  • 213
  • 2
  • 6

How to modify execution orders for Snakemake?

My goal is to process two samples, S1 and S2, using two rules, step1, step2. The Snakemake file is like:

samples = ['S1', 'S2']
rule all:
  input: "S1.done", "S2.done"

rule step1:
  input: {sample}
  output: {sample}.step1.done
  shell: "touch {output}"
rule step2:
  input: {sample}.step1.done
  output: {sample}.done
  shell: "touch {output}"

The current execution order is:

step1 on S1
step1 on S2
step2 on S1
step2 on S2

Is there a way to change the order to:

step1 on S1
step2 on S1
step1 on S2
step2 on S2

Basically, I want to complete S1, then S2. Is there a way to specify the order of executions in Snakemake?