Parallelizing snakemake rule

﹥>﹥吖頭↗ 提交于 2019-12-01 20:45:34

Currently, your workflow indeed consists in applying the "vep" rule only once, where it executes vep with all your inputs and outputs as arguments. I don't know how vep works, but it is likely either failing or not doing what you expect.

You should probably write your rule's input and output without expansion, and drive it using an "all" rule, that does the expand:

CHROMS = [str(c) for c in range(1, 23)] + ["X"]


rule all:
    input:
        expand("data/vep/split/chr{chrom}.ann.vcf",
               chrom=CHROMS)

rule vep:
    input:
        "data/split/chr{chrom}.vcf"
    output:
        "data/vep/split/chr{chrom}.ann.vcf"
    shell:
        "vep "
        "{input} "
        "{output}"

To generate the desired input of the "all" rule, snakemake will determine how many times and how (i.e. with what value for the chrom wildcard) it needs to apply the "vep" rule.

Be sure to put the "all" rule before all other rules.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!