【问题标题】:use conda skeleton to build an r bioconductor package使用 conda 骨架构建 r 生物导体包
【发布时间】:2018-04-06 22:21:24
【问题描述】:

我知道安装 r 包通常更容易,即使在 condas 中,使用 install packages 或类似的。但我也知道我通常可以构建自己的包,例如

conda skeleton cran tensorA
conda build r-tensorA
conda install --use-local r-tensorA

但是如果包位于bioconda,而不是cran,该怎么办? DECIPHER,例如可以通过running在R中安装

source("https://bioconductor.org/biocLite.R")
biocLite("DECIPHER")

主要出于学习目的,我想尝试将 DECIPHER(和其他生物导体包)构建到 condas 包中。谁能指出我做这样的事情的好方向?或者,如果您真的感觉棒极了,请列出您将采取的步骤?

【问题讨论】:

    标签: r conda


    【解决方案1】:

    好的。以下是我设法解决这个问题的方法:

    我使用来自另一个 r-build 的 conda 骨架文件作为模板。事实证明,对于生物导体包here's an example,在标题 Source Repository 下有一个指向 git 存储库的链接。

    我发现以下指南很有帮助 here

    我最终制作了一个如下所示的 meta.yaml 文件

     package:
      name: r-decipher
      version: "2.6.0"
    
    source:
      git_url: https://git.bioconductor.org/packages/DECIPHER
    
    requirements:
      build:
        - r
        - bioconductor-biostrings
        - r-rsqlite
    
      run:
        - r
        - bioconductor-biostrings
        - r-rsqlite
    test:
    test:
      commands:
        # You can put additional test commands to be run here.
        - $R -e "library('DECIPHER')"           # [not win]
        - "\"%R%\" -e \"library('DECIPHER')\""  # [win]
    
    about:
      home: https://bioconductor.org/packages/release/bioc/html/DECIPHER.html
    

    我还制作了一个如下所示的 build.sh 文件:

    #!/bin/bash
    
    if [[ $target_platform =~ linux.* ]] || [[ $target_platform == win-32 ]] || [[ $target_platform == win-64 ]] || [[ $target_platform
    

    == osx-64 ]];然后 导出 DISABLE_AUTOBREW=1 mv 描述DESCRIPTION.old grep -v '^Priority: 'DESCRIPTION.OLD>DESCRIPTION $R CMD 安装 --build 。 别的 mkdir -p $PREFIX/lib/R/library/decipher mv * $PREFIX/lib/R/library/decipher 菲

    还有一个bld.bat,如下所示

    "%R%" CMD INSTALL --build .
    IF %ERRORLEVEL% NEQ 0 exit 1
    

    所有这些都放在一个名为 r-decipher 的源目录中。

    从那个目录之外的目录中我运行了conda build,它起作用了(我可能不得不安装一些依赖项,但它在命令行上抱怨它们并且每个至少在 CRAN 中可用)然后运行@ 987654329@。

    如果有人想使用我的特定版本的 r-decipher,现在可以在 https://anaconda.org/cramjaco/r-decipher 找到它

    【讨论】:

    • 我无法复制让它在其他系统上运行,也无法使用我的在线构建。
    猜你喜欢
    • 2017-03-16
    • 2017-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-29
    • 2016-08-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多