在上一个问题之后得到帮助,此代码创建了目标(两个目录中每个目录中名为“ 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}"
感谢您的帮助
我认为您应该在命令行中传递目标文件名作为配置选项,并使用该选项在Snakefile中构造文件名: