Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run only one rule in snakemake

Tags:

snakemake

I have created a workflow within snakemake, I Have a problem when I want to run just one rule. Indeed it runs for me the rules where the output is the input of my rule even if those one are already created before.

Example :

rule A:
 input A
 output A

rule b:
 input b = output A
 output b

rule c:
 input c = output b
 output c

How can I run just the rule C?

like image 612
BioManil Avatar asked Apr 24 '19 14:04

BioManil


2 Answers

If there are dependencies, I have found that only --until works if you want to run rule C just run snakemake -R --until c. If there are assumed dependencies, like shared input or output paths, it will force you to run the upstream rules without the use of --until. Always run first with -n for a dry-run.

like image 108
jimh Avatar answered Sep 19 '22 12:09

jimh


You just run:

snakemake -R b

To see what this will do in advance:

snakemake -R b -n

-R selects the one rule (and all its dependent rules also!), -n does a "dry run", it just prints what it would do without -n.

like image 44
Freek Avatar answered Sep 19 '22 12:09

Freek