context.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:toil-vg 作者: vgteam 项目源码 文件源码
def run_write_info_to_outstore(job, context, argv):
    """ Writing to the output is still problematic, especially from within jobs.  So 
    we write some options info into the output store first-thing to trigger errors
    before doing all the compute if possible.  To do this, this job needs to be passed
    to the root of the workflow """

    f = tempfile.NamedTemporaryFile(delete=True)
    now = datetime.datetime.now()
    if argv:
        f.write('{}\n\n'.format(' '.join(argv)))
    f.write('{}\ntoil-vg version {}\nConfiguration:\n'.format(now,
        pkg_resources.get_distribution('toil-vg').version))

    for key, val in context.config.__dict__.items():
        f.write('{}: {}\n'.format(key, val))
    f.flush()
    context.get_out_store().write_output_file(f.name, 'toil-vg-{}.txt'.format(
        argv[1] if argv and len(argv) > 1 else 'info'))
    f.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号