-1

I know that its generally easier to install r packages, even within condas, using install packages, or similar. But I also know that I can usually build my own package with, for instance

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

But what if the package lives in bioconda, rathaer than cran? DECIPHER, for instance can be installed within R by running

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

For primarily learning purposes, I'd like to try to build DECIPHER (and other bioconductor packages) into a condas package. Can anyone point me in a good direction to do something like this? Or if you are really feeling awesome, ouline the steps one would take?

ohnoplus
  • 1,205
  • 1
  • 17
  • 29

1 Answers1

0

Ok. Here's how I managed to solve this:

I used conda skeleton files from another r-build as a template. It turns out, that for bioconductor packages here's an example, there is a link to the git repository under the heading Source Repository.

I found the following guide helpful here.

I ended up making a meta.yaml file that looks like this

 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

I also made a build.sh file that looks like the following:

#!/bin/bash

if [[ $target_platform =~ linux.* ]] || [[ $target_platform == win-32 ]] || [[ $target_platform == win-64 ]] || [[ $target_platform

== osx-64 ]]; then export DISABLE_AUTOBREW=1 mv DESCRIPTION DESCRIPTION.old grep -v '^Priority: ' DESCRIPTION.old > DESCRIPTION $R CMD INSTALL --build . else mkdir -p $PREFIX/lib/R/library/decipher mv * $PREFIX/lib/R/library/decipher fi

And a bld.bat that looks like the following

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

All of these went in a source directory called r-decipher.

From the directory outside of that one I ran conda build, which worked (I may have had to install some dependencies, but it complains about them on the command line and each is available in CRAN at least) and then ran conda install r-decipher.

If anyone wants to use my specific build of r-decipher, it can now be found at https://anaconda.org/cramjaco/r-decipher

ohnoplus
  • 1,205
  • 1
  • 17
  • 29
  • I haven't been able to replicate getting this to work on other systems, nor to use my online build. – ohnoplus Mar 06 '20 at 16:44