繁体   English   中英

集群上的 Snakemake:OutputException 并为每个通配符项目提交一个作业

[英]Snakemake on cluster: OutputException and submit one job for each wildcard item

我尝试在带有LSF profile 的LSF 上使用 snakemake ,但是在使用通配符时只提交了一项作业。

Submitted job 1 with external jobid '660343 logs/cluster/try_expand/unique/jobid1_4530cab3-d29c-485d-8d46-871fb7042e50.out'.

下面是一个运行的最小示例

snakemake --profile lsf -s try.smk 2> `date +"%Y%m%d_%H%M"`_snakemake_try.log --latency-wait 20
CHROMOSOMES = [ 20, 21, 22]

rule targets:
    input: 
         expand("try/chr{chromosome}.GATK_calls.indels.PASS.common_var_2.bcf", chromosome=CHROMOSOMES)
    log:
        "try_logs/targets.log"

rule try_expand:
    threads: 6
    output:
        expand("try/chr{chromosome}.GATK_calls.indels.PASS.common_var_2.bcf", chromosome=CHROMOSOMES) 
    shell:"""
        touch {output}
    """

上述命令的日志文件在这里 我怀疑这是在运行需要很长时间才能完成第一个通配符的较大任务时出现 OutputException 的原因。

Waiting at most 20 seconds for missing files.
MissingOutputException in line 22 of extraction.smk:
Missing files after 20 seconds:
chr21.GATK_calls.indels.PASS.common_var.bcf
chr22.GATK_calls.indels.PASS.common_var.bcf

如何避免 OutputException 并将每个通配符项作为作业提交? 谢谢!

您混淆了扩展函数的通配符和变量。 您的规则try_expand在输出中定义了三个文件,因此它只会运行一次以生成所有目标。 在输出中, {chromosome}不是通配符,而是 expand 函数的第二个参数的占位符。

你可能想要的是:

CHROMOSOMES = [ 20, 21, 22]

rule targets:
    input: 
         expand("try/chr{chromosome}.GATK_calls.indels.PASS.common_var_2.bcf", chromosome=CHROMOSOMES)
    log:
        "try_logs/targets.log"

rule try_expand:
    threads: 6
    output:
        "try/chr{chromosome}.GATK_calls.indels.PASS.common_var_2.bcf" 
    shell:
    """
        touch {output}
    """

请注意,如果您需要在扩展函数中使用通配符,则必须将{}加倍。
例子:

output: expand("{path}/chr{{chromosome}}.GATK_calls.indels.PASS.common_var_2.bcf", path="/my/path")

这里, {path}是在 expand 函数的第二个参数中定义的占位符, {{chromosome}}是通配符。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM