5

I am trying to use a Snakefile that does something like this:

rule split_files:
    input:
        '{pop}.bam'
    output:
        dynamic('{pop}_split/{chrom}.sam')
    shell:
        "something"

rule work:
    input:
        sam='{pop}_split/{chrom}.sam',
        snps='snps/{chrom}_snps'
    output:
        '{pop}_split/{chrom}_parsed.sam'
    shell:
        "something"

rule combine:
    input:
        dynamic('{pop}_split/{chrom}_parsed.sam')
    output:
        '{pop}_merged.sam'
    shell:
        "something"

This results in the error:

Missing input files for rule work:
snps/__snakemake_dynamic___snps

Adding dynamic to both of the inputs for the work rule results in the same error.

I need to do this because some populations have chrY and others do not, so I can't just expand with a chromosome list (actually I can with another work around that I am currently using, but it is cumbersome).

Mike D
  • 727
  • 2
  • 10
  • 26
  • Is `dynamic` still a thing in Snakemake v6? Haven't encountered it in the current docs at all. – Cornelius Roemer Jul 02 '21 at 16:23
  • `dynamic` was deprecated in snakemake [5.4.0](https://snakemake.readthedocs.io/en/stable/project_info/history.html?highlight=dynamic#id204) and replaced by `checkpoint`s – bricoletc Dec 04 '21 at 10:14

0 Answers0