有效实现计算再现性的集成分析平台

choppy-pipe的Python项目详细描述


< Buff行情>

作者:杨靖成

电子邮件:yjcyxky@163.com

日期:2018-12-13

对于可复制的omics管道来说,不稳定

中文字

简介

Choppy是一个命令行&;Web工具,用于在Cromwell服务器上执行WDL工作流。(基于widdler,但更多。) 功能包括:

  • 工作流执行:在指定的克伦威尔服务器上执行工作流。
  • 工作流重新启动:重新启动以前执行的工作流。
  • 工作流查询:获取特定工作流的状态、元数据或日志。
  • 工作流结果说明:在命令行获取有关失败的详细信息。
  • 工作流监视:监视特定工作流或一组特定于用户的工作流以完成。
  • 工作流中止:中止正在运行的工作流。
  • json验证:根据要使用的wdl文件验证json输入文件。

依赖关系

Choppy需要在您的环境中加载Python3+和Java-1.8,才能使全部功能正常工作。

安装

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"

用法

下面是Choppy的基本帮助文本。波比期望三种使用模式之一 显示为第一个参数:run、query或abort。

usage: choppy <positional argument> [<args>]

Description: A tool for executing and monitoring WDLs to Cromwell instances.

positional arguments:
  {restart,explain,log,abort,monitor,query,run,validate,label,email,upload,batch,testapp,install,apps}

optional arguments:
  -h, --help            show this help message and exit

不稳定提交

下面是Shappy的提交帮助文本。它希望用户提供一个WDL文件, json文件,并指示可供执行的服务器之一。验证选项 验证已提交的WDL和JSON文件,并在默认情况下启用。

usage: choppy submit <wdl file> <json file> [<args>]

Submit a WDL & JSON for execution on a Cromwell VM.

positional arguments:
  wdl                   Path to the WDL to be executed.
  json                  Path the json inputs file.

optional arguments:
  -h, --help            show this help message and exit
  -v, --validate        Validate WDL inputs in json file. (default: False)
  -l LABEL, --label LABEL
                        A key:value pair to assign. May be used multiple
                        times. (default: None)
  -m, --monitor         Monitor the workflow and receive an e-mail
                        notification when it terminates. (default: False)
  -i INTERVAL, --interval INTERVAL
                        If --monitor is selected, the amount of time in
                        seconds to elapse between status checks. (default: 30)
  -o EXTRA_OPTIONS, --extra_options EXTRA_OPTIONS
                        Additional workflow options to pass to Cromwell.
                        Specify as k:v pairs. May be specified multipletimes
                        for multiple options. See
                        https://github.com/broadinstitute/cromwell#workflow-
                        optionsfor available options. (default: None)
  -V, --verbose         If selected, choppy will write the current status to
                        STDOUT until completion while monitoring. (default:
                        False)
  -n, --no_notify       When selected, disable choppy e-mail notification of
                        workflow completion. (default: False)
  -d DEPENDENCIES, --dependencies DEPENDENCIES
                        A zip file containing one or more WDL files that the
                        main WDL imports. (default: None)
  -D, --disable_caching
                        Don\'t used cached data. (default: False)
  -S {localhost,remote}, --server {localhost,remote}
                        Choose a cromwell server from ['localhost','remote'] (default: None)

例如:

断断续续地提交myworkflow.wdl myinput.json-s remote

如果提交成功,将返回工作流ID和状态,例如:

{'id':'2f8bb5c6-8254-4d38-b010-620913dd325e','status':'submitted'}

这将执行使用子工作流的工作流:

断断续续地提交myworkflow.wdl myinput.json-s remote-d mydependencies.zip

用户也可以在启动工作流时调用choppy的监视功能。有关 监控选项说明。

断续重启

如果工作流以前已在克伦威尔服务器上执行过,则可以在执行后重新启动工作流。 只需提供原始运行的工作流id和服务器,就可以使用相同的输入完成并再次运行它。 执行此操作的用法如下:

usage: choppy restart <workflow id>

Restart a submitted workflow.

positional arguments:
  workflow_id           workflow id of workflow to restart.

optional arguments:
  -h, --help            show this help message and exit
  -S {localhost,remote}, --server {localhost,remote}
                        Choose a cromwell server from ['localhost','remote']
                        (default: None)

例如:

choppy restart b931c639-e73d-4b59-9333-be5ede4ae2cb -S remote

将重新启动工作流b931xxx并返回新的工作流ID,如下所示:

Workflow restarted successfully; new workflow-id: 164678b8-2a52-40f3-976c-417c777c78ef

最后,任何重新启动的工作流都将继承其原始工作流的标签。

断断续续的查询

下面是Choppy的查询帮助文本。除了工作流id之外,它还需要一个或多个可选的 请求基本状态、元数据和/或日志的参数。

usage: choppy query <workflow id> [<args>]

Query cromwell for information on the submitted workflow.

positional arguments:
  workflow_id           workflow id for workflow execution of interest.
                           (default: None)

optional arguments:
  -h, --help            show this help message and exit
  -s, --status          Print status for workflow to stdout (default: False)
  -m, --metadata        Print metadata for workflow to stdout (default: False)
  -l, --logs            Print logs for workflow to stdout (default: False)
  -u USERNAME, --username USERNAME
                       Owner of workflows to monitor. (default: amr)
  -L LABEL, --label LABEL
                       Query status of all workflows with specific label(s).
                       (default: None)
  -d DAYS, --days DAYS  Last n days to query. (default: 7)
  -S {localhost,remote}, --server {localhost,remote}
                       Choose a cromwell server from ['localhost','remote'] (default: None)
  -f {Running,Submitted,QueuedInCromwell,Failed,Aborted,Succeeded}, --filter {Running,Submitted,QueuedInCromwell,Failed,Aborted,Succeeded}
                       Filter by a workflow status from those listed above.
                       May be specified more than once. (default: None)
  -a, --all             Query for all users. (default: False)

例如: 波涛汹涌的2f8bb5c6-8254-4d38-b010-620913dd325e查询-s-s远程

将返回如下内容:

[{id':'2f8bb5c6-8254-4d38-b010-620913dd325e','status':'running'}]

和:

断断续续的查询2f8bb5c6-8254-4d38-b010-620913dd325e-m-s-s remote

将返回大量类似so的信息(为可视性而截断):

{'status': 'Running', 'submittedFiles': {'workflow': '# GATK WDL\r\n# import "hc_scatter.wdl" as sub\r\n\r\ntask VersionCheck {\r\n    String gatk\r\n    command {\r\n        source
/broad/software/scripts/useuse\r\n        use Java-1.8\r\n        use Python-2.7\r\n... 'ref': '/cil/shed/sandboxes/amr/dev/gatk_pipeline/output/pfal_5/Plasmodium_falciparum_3D7.fasta'}}]}, 'submi
ssion': '2017-07-14T11:26:05.931-04:00', 'workflowName': 'gatk', 'outputs': {}, 'id': '2f8bb5c6-8254-4d38-b010-620913dd325e'}]

和:

断断续续的查询2f8bb5c6-8254-4d38-b010-620913dd325e-l-s-s remote

[{'id': '2f8bb5c6-8254-4d38-b010-620913dd325e', 'calls': {'gatk.MakeSampleDir': [{'shardIndex': 0, 'attempt': 1, 'stderr': '/cil/shed/apps/internal/cromwell_new/cromwell-executions/ga
   tk/2f8bb5c6-8254-4d38-b010-620913dd325e/call-MakeSampleDir/shard-0/execution/stderr', 'stdout': '/cil/shed/apps/internal/cromwell_new/cromwell-executions/gatk/2f8bb5c6-8254-4d38-b010-
   620913dd325e/call-MakeSampleDir/shard-0/execution/stdout'}

断续中止

下面是波比的中止用法。只需提供

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
0

这个例子: 断续中止2f8bb5c6-8254-4d38-b010-620913dd325e-s遥控器

将返回:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
1

断断续续的解释

运行choppy explain将在命令行提供类似于监视器电子邮件的信息,包括工作流 状态、根目录、stdout和stderr信息以及有用的链接。用法如下:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
2

此示例:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
3

将返回:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
4

注意在这种情况下,工作流中失败的步骤没有stdout或stderr。

验证

(需要Java-1.8,因此在尝试验证之前请确保"使用Java-1.8"。

不稳定的验证尝试根据WDL验证用户提供的JSON文件中的输入 提供的WDL文件中的参数。默认情况下,验证处于关闭状态,因此用户必须使用 如果使用不规则提交,-v标志。如果您 希望在不执行工作流的情况下验证输入。

它将验证以下内容:

  • json中的参数值与wdl期望的值类型相同。例如 如果WDL需要一个整数,而参数提供一个浮点数,则会将其标记为错误。
  • 如果参数是file类型,则文件存在于文件系统中。
  • 如果WDL不需要JSON中指定的参数。
  • 如果参数包含字符串"samples_file",则其值将被解释为输入tsv文件,其中 每行的最后一列表示一个示例文件。在这种情况下,将对每个 示例文件。

它不会验证以下内容:

  • 数组的内容。它无法区分字符串数组和整数数组之间的区别,但是 它可以告诉它们是数组,如果一个参数需要一个数组,但是提供了其他东西,那么 作为错误记录。

关于使用依赖项验证WDL文件的说明:由于当前实现的限制 在依赖性验证中,WDL文件依赖项必须与主WDL文件位于同一目录中 必须拉开拉链。否则验证可能不起作用。

验证也可以作为独立的操作运行,使用不稳定的验证。用法如下:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
5

例如:

波涛汹涌的mywdl.wdl myjson.json

如果json文件有错误,将以运行时验证报告的方式报告错误列表。 例如:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
6

波涛汹涌的原木

运行"断断续续日志"将打印以筛选工作流的每个任务使用的命令。例如,运行:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
7

结果如下:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
8

不稳定监视器

不稳定允许监视工作流。与查询选项不同,监视将持续到工作流到达 终端状态(除了"运行"或"提交"之外的任何状态)。在监视时,它可以选择打印 到屏幕的工作流,当到达终端状态时,它可以选择向用户发送电子邮件(假定为用户 当工作流程完成时,转到broadinstitute.org域。

监视使用情况如下:

virtualenv .env
source .env/bin/activate
pip install choppy-0.2.0.tar.gz

# Activate bash auto-complete
activate-global-python-argcomplete
eval "$(register-python-argcomplete choppy)"
9

单工作流监视

除了使用chobby的run命令监视单个工作流外,还可以执行监视器,如 以下示例:

usage: choppy <positional argument> [<args>]

Description: A tool for executing and monitoring WDLs to Cromwell instances.

positional arguments:
  {restart,explain,log,abort,monitor,query,run,validate,label,email,upload,batch,testapp,install,apps}

optional arguments:
  -h, --help            show this help message and exit
0

在这种情况下,Choppy将继续静默监视此工作流,直到它检测到终端状态为止。安 当检测到终端状态时,电子邮件将发送到<;user>;@broadinstitute.org,其中包括 工作流的元数据。

如果选择了--verbose,用户将看到一条stdout消息,每隔一段时间显示工作流状态 由--interval参数定义,默认值为30秒。

如果--未选择"通知",则不会发送电子邮件。

用户工作流监视

(请注意,此功能仍在积极开发中,目前还相当原始)

用户还可以通过省略Workflow ID参数并指定 --这样的用户参数:

usage: choppy <positional argument> [<args>]

Description: A tool for executing and monitoring WDLs to Cromwell instances.

positional arguments:
  {restart,explain,log,abort,monitor,query,run,validate,label,email,upload,batch,testapp,install,apps}

optional arguments:
  -h, --help            show this help message and exit
1

在这里,用户"amr"使用chobby监视他执行过的所有工作流。未由执行的任何工作流 不监视波比。执行前处于终端状态的工作流将有一封电子邮件耳鼻喉科 关于它们的状态,任何正在运行的工作流在终止后都将生成电子邮件。使用--verbose 此处的选项将导致按--interval指定的间隔监视的每个工作流的stdout输出。

日志记录

在名为chobby.log的文件中的应用程序日志目录中记录信息。 这有助于查找有关不稳定执行的信息,包括工作流id和查询 结果,可以帮助用户查找丢失的工作流ID。日志中的每次执行 以这样的方式显示,用户的用户名显示在 方便识别。

usage: choppy <positional argument> [<args>]

Description: A tool for executing and monitoring WDLs to Cromwell instances.

positional arguments:
  {restart,explain,log,abort,monitor,query,run,validate,label,email,upload,batch,testapp,install,apps}

optional arguments:
  -h, --help            show this help message and exit
2

路线图

2018年12月12日

  • 为批处理子提交WDL工作流添加批处理模式。
  • 添加应用程序回购。这些应用程序在一些类似的项目中反复使用

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在一个问题被连续正确回答三次/并添加差异后,我如何将程序循环回开始   Java中未实例化的匿名类   java如何在Android中录制视频,只允许横向模式和最长时间录制时间   java从另一个活动发送实时消息   多线程java线程和互斥   java禁用Spring安全日志   JAVA伊奥。StreamCorruptedException:在与子级和父级ProcessBuilder通信时写入子级中的标准输出时,流头无效   使用Java(HttpURLConnection)对Restheart进行身份验证(对于Mongodb)   java如何解决Jenkins中的SAXParseException?   java为什么我需要mockito来测试Spring应用程序?   计算sin-cos和tan时缺乏精度(java)   java Hibernate。不同项目中相同一对一映射的不同行为   java图像滑块:如何使用JavaFX将图像放在另一个图像上   java Mockito在使用when时抛出NotAMockException   http Java servlet发送回响应