I am creating a snakemake pipeline where I have, in some point, to filter my results. But there are two kind of filters that I could apply, so I would like to give it as an argument when launching the pipelin and then, depending on the argument, I would like to apply a rule or another.
As an example:
snakemake --snakefile my_pipeline.sm --config filter=${1}
where filter can be Hard or Soft
my_pipeline.sm is conformed by 4 rules:
rule A:
input:
A.bam
outpu:
A.vcf
shell:
"do.something"
rule B:
input:
A.vcf
output:
A.hard_filtered.vcf
shell:
"do.something"
rule C:
input:
A.vcf
output:
A.soft_filtered.vcf
shell:
"do.something"
rule D:
input:
A.*_filtered.vcf
output:
A.annotated.vcf
shell:
"do.something"
Is there anyway to execute rule B if filter argument is Hard, while executing rule C if filter argument is Soft; instead of performing a conditional clausule in the shell command of a unique rule? I didn't find this information in snakemake manual.