在 Snakemake 规则中使用 Github URL 作为包装器 [英] Use Github URL for wrapper in Snakemake rule

查看:62
本文介绍了在 Snakemake 规则中使用 Github URL 作为包装器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在 Snakefile 中定义基于包装器的规则的三种工作方法:

I know three working ways to define a wrapper-based rule in a Snakefile:

rule way1_wrapper_repository:
    wrapper:
        "0.0.8/bio/samtools_sort"
rule way2_local_relative_directory:
    wrapper:
        "local_wrappers/dir/samtools_sort"
rule way3_local_absolute_directory:
    wrapper:
        "file:///absolute/path/to/wrapper/samtools_sort"

文档说明:

或者,例如,对于开发,包装器指令还可以指向完整的 URL,包括具有绝对路径 file://或相对路径 file: 的本地文件的 URL.可以在 Snakemake Wrapper Repository 的 wrapper 子目录中的 README 中找到每个包装器的示例.

Alternatively, e.g., for development, the wrapper directive can also point to full URLs, including URLs to local files with absolute paths file:// or relative paths file:. Examples for each wrapper can be found in the READMEs located in the wrapper subdirectories at the Snakemake Wrapper Repository.

但是,例如,我还没有找到使用指向 github 上包装器目录的 URL 的方法(请注意,我想使用未托管在默认 snakemake 包装器存储库中的包装器).

However I have not yet found a way to use a URL pointing to a wrapper directory on github for example (Note that I want to use wrappers NOT hosted on the default snakemake wrapper repository).

请注意,这对我来说是一种XY 问题!我实际上想定义一个相对于 Snakefile 的本地包装器,这仅在 workdir 与 Snakefile 位于同一目录时才可能:包装器的相对路径将始终相对于工作目录进行评估,这使得很难包含 snakemake 项目或使用独立的工作目录(在这种情况下,需要将包装器复制到备用工作目录).

Note that this is kind of an XY problem for me! I actually want to define a local wrapper relative to the Snakefile which is only possible when the workdir is the same directory as the Snakefile: The relative path to the wrapper will always be evaluated relative to the workdir which makes it hard to include the snakemake project or use an independent workdir (the wrapper would need to be copied to the alternative workdir in that case).

推荐答案

我现在尝试使用原始"github 链接并且它有效.因此,请尝试以下操作:

I now tried to use the "raw" github link and it works. So try something like:

rule way4_remote_github_repository:
wrapper:
    "https://raw.gtihubusercontent.com/<githubuser>/<repository>/<branch>/path/to/wrapper/directory/"

这篇关于在 Snakemake 规则中使用 Github URL 作为包装器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆