snakemake。创建多个目标时如何从命令行传递目标

问题描述 投票:0回答:1

在上一个问题之后得到帮助,此代码创建了目标(两个目录中每个目录中名为“ practice_phased_reversed.vcf”的文件的副本。

dirs=['k_1','k2_10']
rule all:
        input:
                expand("{f}/practice_phased_reversed.vcf",f=dirs)
rule r1:
        input:
                "practice_phased_reversed.vcf"
        output:
                "{f}/{input}"
        shell:
               "cp {input} {output}"

但是,我想在snakemake命令行上传递目标文件。我使用命令“ snakemake practice_phased_reversed.vcf”尝试了此操作(以下),但是它给出了一个错误:“ MissingRuleException:没有规则可以产生Practice_phased_reversed.vcf”

dirs=['k_1','k2_10']
rule all:
        input:
                expand("{f}/{{base}}_phased_reversed.vcf",f=dirs)
rule r1:
        input:
                "{base}_phased_reversed.vcf"
        output:
                "{f}/{input}"
        shell:
               "cp {input} {output}"

感谢您的帮助

snakemake
1个回答
0
投票

我认为您应该在命令行中传递目标文件名作为配置选项,并使用该选项在Snakefile中构造文件名:

© www.soinside.com 2019 - 2024. All rights reserved.