sbg python库创建cwl工具和工作流
sevenbridges-cwl的Python项目详细描述
塞文布里奇CWL目录
Overview
sevenbridges cwl包为 通用工作流语言。它是为那些想使用 生成cwl文档的python代码。如果通过gui创建文档 更可取,然后看看 Rabix Composer。
Install
官方发布
官方版本可通过pip install sevenbridges-cwl
获得(这是本项目的pypi entry)
开发版本
要获取未发布的版本:
git clone
此存储库cd sevenbridges-cwl && pip install .
master
分支用于更稳定的代码,而develop
分支用于当前正在处理的尖端功能
Docs
完整的文档可以找到here。
如果您有兴趣在本地查看此文档,请克隆此
存储库,将自己放置在docs
目录中,并在安装之后
requirements-dev.txt
,调用:
make html
Run Tests
为了运行测试克隆此存储库,请将自己定位到
克隆的项目,在安装requirements-dev.txt
之后,调用:
pytest
Examples
下面的代码将简要概述此软件包可以通过 简单的例子。
可以找到所有示例的完整列表here。
Run workflow on a SevenBridges platform
fromsbgimportcwl# First node@cwl.to_tool(inputs=dict(x=cwl.String()),outputs=dict(out=cwl.Float(required=True)),docker='images.sbgenomics.com/filip_tubic/ubuntu1604py')defto_float(x):returndict(out=float(x))# Second node@cwl.to_tool(inputs=dict(x=cwl.Float(),n=cwl.Int()),outputs=dict(out=cwl.Float()),docker='images.sbgenomics.com/filip_tubic/ubuntu1604py')deftimes_n(x,n=10):returndict(out=x*n)wf=cwl.Workflow()# create toolst1=to_float()t2=times_n()# stepswf.add_step(t1,expose=['x'])wf.add_step(t2,expose=['n','out'])# add connectionswf.add_connection(f'{t1.id}.out',f'{t2.id}.x')# Session on a SBG platformsession=cwl.Session(profile='<your_profile>')session.run('<your_project>',wf,inputs={'x':'10.2'})