我是蛇制作新手。我有一条规则可以将文件复制到多个文件夹。文件夹是用python制作的。关于多个目标,我一定会误会。使用“ Snakemake practice_phased_reversed.vcf”运行时,以下代码返回“没有规则可以产生Practice_phased_reversed.vcf”
s=['k_1','k2_10']
fullfs = []
import os
cdir = os.getcwd()
for f in fs:
path = os.path.join(cdir,f)
fullfs.append(path)
try:
os.mkdir(path)
except:
pass
rule r1:
input:
"{basename}_phased_reversed.vcf"
output:
expand("{f}/{{basename}}_phased_reversed.vcf",f=fullfs)
shell:
"cp {input} {output}"
感谢Maarten-vd-Sande。现在,这可以使用“ snakemake”运行,即无需传递目标文件名。
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}/practice_phased_reversed.vcf"
shell:
"cp {input} {output}"
但是我仍然缺少一些东西。我需要能够使用目标(即“ snakemake practice_phased_reversed.vcf”)进行调用。感谢您的帮助。