大佬教程收集整理的这篇文章主要介绍了蛇形 - 用检查点替换动态(),大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有以下蛇形制作工作流程:
rule all:
input:
dynamic(os.path.join(config['out_dir'],'{CHR}','{CHR}.fa'))
output:
config['out_dir'] + '/all.fasta'
shell:
"""
cat {input} > {output}
"""
rule split_genome_to_chr:
"""
Split the input genome fasta to
multiple fastas with one chromosome
in each.
"""
input:
config['input_genome']
output:
dynamic(os.path.join(config['out_dir'],'{CHR}.fa'))
params:
out_dir=config['out_dir'],conda:
CONDA_ENV_DIR + '/faSplit.yml'
shell:
"""
faSplit byname {input} {params.out_dir}/ -outDirDepth=1
"""
这工作正常,但会打印一些关于弃用 dynamic() 以支持检查点的警告。
我浏览了检查点文档,但仍然无法弄清楚如何更改我的代码,因此它使用检查点而不是动态。这是我尝试过的:
def aggregate_input(wildcards):
return checkpoints.split_genome_to_chr.get(chrom=wildcards.CHR).output[0]
rule all:
input:
aggregate_input
output:
config['out_dir'] + '/all.fasta'
shell:
"""
cat {input} > {output}
"""
checkpoint split_genome_to_chr:
"""
Split the input genome fasta to
multiple fastas with one chromosome
in each.
"""
input:
config['input_genome']
output:
os.path.join(config['out_dir'],'{CHR}.fa')
params:
out_dir=config['out_dir'],conda:
CONDA_ENV_DIR + '/faSplit.yml'
shell:
"""
faSplit byname {input} {params.out_dir}/ -outDirDepth=1
"""
但收到错误消息:
inputFunctionException in line 51 of workflow.snakefile:
AttributeError: 'Wildcards' object has no attribute 'CHR'
Wildcards:
任何帮助将不胜感激!
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的蛇形 - 用检查点替换动态()全部内容,希望文章能够帮你解决蛇形 - 用检查点替换动态()所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。