Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
added 27 characters in body
Source Link
goi42
  • 65
  • 9

Generating output based on changed input files in Snakemake is easy:

rule all: input: [f'out_{i}.txt' for i in range(10)] rule make_input: output: 'in_{i}.txt' shell: 'touch {output}' rule make_outputmake_output_parallel: input: 'in_{i}.txt' output: 'out_{i}.txt' shell: 'touch {output}' 

In this case, make_output will only run for instances where in_{i}.txt have changed.

But suppose the 'out_{i}.txt' cannot be generated in parallel and I want to generate them in a single step, like,

rule make_outputmake_output_one_step: input: [f'in_{i}.txt' for i in range(10)] output: [f'out_{i}.txt' for i in range(10)] shell: 'touch {output}' 

If only one of the in_{i}.txt files have changed, I don't need to regenerate all 10 of them. How can I adjust make_outputmake_output_one_step.output to generate only the needed files?

Generating output based on changed input files in Snakemake is easy:

rule all: input: [f'out_{i}.txt' for i in range(10)] rule make_input: output: 'in_{i}.txt' shell: 'touch {output}' rule make_output: input: 'in_{i}.txt' output: 'out_{i}.txt' shell: 'touch {output}' 

In this case, make_output will only run for instances where in_{i}.txt have changed.

But suppose the 'out_{i}.txt' cannot be generated in parallel and I want to generate them in a single step, like,

rule make_output: input: [f'in_{i}.txt' for i in range(10)] output: [f'out_{i}.txt' for i in range(10)] shell: 'touch {output}' 

If only one of the in_{i}.txt files have changed, I don't need to regenerate all 10 of them. How can I adjust make_output.output to generate only the needed files?

Generating output based on changed input files in Snakemake is easy:

rule all: input: [f'out_{i}.txt' for i in range(10)] rule make_input: output: 'in_{i}.txt' shell: 'touch {output}' rule make_output_parallel: input: 'in_{i}.txt' output: 'out_{i}.txt' shell: 'touch {output}' 

In this case, make_output will only run for instances where in_{i}.txt have changed.

But suppose the 'out_{i}.txt' cannot be generated in parallel and I want to generate them in a single step, like,

rule make_output_one_step: input: [f'in_{i}.txt' for i in range(10)] output: [f'out_{i}.txt' for i in range(10)] shell: 'touch {output}' 

If only one of the in_{i}.txt files have changed, I don't need to regenerate all 10 of them. How can I adjust make_output_one_step.output to generate only the needed files?

added 72 characters in body
Source Link
goi42
  • 65
  • 9

Generating output based on changed input files in Snakemake is easy:

rule all: input: [f'out_{i}.txt' for i in range(10)] rule make_input: output: 'in_{i}.txt' shell: 'touch {output}' rule make_output: input: 'in_{i}.txt' output: 'out_{i}.txt' shell: 'touch {output}' 

In this case, make_output will only run for instances where in_{i}.txt have changed.

But suppose the 'out_{i}.txt' cannot be generated in parallel and I want to generate them in a single step, like,

rule make_output: input: [f'in_{i}.txt' for i in range(10)] output: [f'out_{i}.txt' for i in range(10)] shell: 'touch {output}' 

If only one of the in_{i}.txt files have changed, I don't need to regenerate all 10 of them. How can I adjust make_output.output to generate only the needed files?

Generating output based on changed input files in Snakemake is easy:

rule all: input: [f'out_{i}.txt' for i in range(10)] rule make_input: output: 'in_{i}.txt' shell: 'touch {output}' rule make_output: output: 'out_{i}.txt' shell: 'touch {output}' 

In this case, make_output will only run for instances where in_{i}.txt have changed.

But suppose the 'out_{i}.txt' cannot be generated in parallel and I want to generate them in a single step, like,

rule make_output: output: [f'out_{i}.txt' for i in range(10)] shell: 'touch {output}' 

If only one of the in_{i}.txt files have changed, I don't need to regenerate all 10 of them. How can I adjust make_output.output to generate only the needed files?

Generating output based on changed input files in Snakemake is easy:

rule all: input: [f'out_{i}.txt' for i in range(10)] rule make_input: output: 'in_{i}.txt' shell: 'touch {output}' rule make_output: input: 'in_{i}.txt' output: 'out_{i}.txt' shell: 'touch {output}' 

In this case, make_output will only run for instances where in_{i}.txt have changed.

But suppose the 'out_{i}.txt' cannot be generated in parallel and I want to generate them in a single step, like,

rule make_output: input: [f'in_{i}.txt' for i in range(10)] output: [f'out_{i}.txt' for i in range(10)] shell: 'touch {output}' 

If only one of the in_{i}.txt files have changed, I don't need to regenerate all 10 of them. How can I adjust make_output.output to generate only the needed files?

Source Link
goi42
  • 65
  • 9

snakemake batch creation of output

Generating output based on changed input files in Snakemake is easy:

rule all: input: [f'out_{i}.txt' for i in range(10)] rule make_input: output: 'in_{i}.txt' shell: 'touch {output}' rule make_output: output: 'out_{i}.txt' shell: 'touch {output}' 

In this case, make_output will only run for instances where in_{i}.txt have changed.

But suppose the 'out_{i}.txt' cannot be generated in parallel and I want to generate them in a single step, like,

rule make_output: output: [f'out_{i}.txt' for i in range(10)] shell: 'touch {output}' 

If only one of the in_{i}.txt files have changed, I don't need to regenerate all 10 of them. How can I adjust make_output.output to generate only the needed files?