Using Bioconda to streamline software installation for bioinformatics


2018-01-30

Andrew Perry,
Monash Bioinformatics Platform

Follow along: https://github.com/MonashBioinformaticsPlatform/bioconda-tutorial/blob/master/Bioconda_Installation.ipynb

Disclaimer: while I'm talking about it, I don't pretend to be a conda / Bioconda expert.

This my whirlwind reinterpretation based on a workshop delivered by Simon Gladman, Saskia Hiltemann and Eric Rasche "Packaging your bioinformatics tool with Bioconda and Galaxy".

Why conda ?

  • Manages self contained environments, including dependencies. No sudo required.

  • Large ecosystem of precompiled packages, organized as 'channels' (eg conda-forge, bioconda)

  • Language agnostic (not only Python !)

  • Creating new packages is straightforward compared with many systems (a recipe composed of a short build.sh and meta.yml).

  • Interoperates gracefully with Python virtualenvs and pip.

  • Open Source tool (BSD), backed by a company (Continuum Analytics). Some compiled packages in the default 'channel' aren't Open Source.

Woah .. waddayamean 'environment'

Conda sets some UNIX shell environment variables, primarily PATH, that determine which copy of a binary is run when you type it's name.

Type:

env

and you will see your environment variables.

Why use Bioconda ?

  • Large ecosystem of pre-packaged software already available, ~250 contributors.

  • Conda environments aid reproducibilty - an environment.yml file can record tool versions (+build number) that can be reliably reinstalled elsewhere.

  • Is the supported tool installation method for Galaxy, so existing packages will be maintained and grow.

  • Quality control - well documented guidelines (http://bioconda.github.io/guidelines.html), automatic testing and package builds (TravisCI / CircleCI), Pull Requests reviewed by core team.

    • Fun fact: Bioconda recipes don't blindly trust version numbers on tools, they use an md5 or sha256 checksum of the source tarball.
  • Docker and Singularity containers are automatically generated too (Biocontainers project)

More sales pitches on this blog and bioArxiv.

Let's install Miniconda and some tools from Bioconda

Miniconda installs the conda package manager in your home directory, in it's own conda 'environment' (Miniconda is a trimmed down version of 'Anaconda').

Miniconda can be found at: https://conda.io/miniconda.html

In [1]:
cd ~
# macOS
curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh

# or Linux
# curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 34.3M  100 34.3M    0     0  15.1M      0  0:00:02  0:00:02 --:--:-- 15.1M
In [2]:
sh ./Miniconda3-latest-MacOSX-x86_64.sh --help
usage: ./Miniconda3-latest-MacOSX-x86_64.sh [options]

Installs Miniconda3 4.3.31

-b           run install in batch mode (without manual intervention),
             it is expected the license terms are agreed upon
-f           no error if install prefix already exists
-h           print this help message and exit
-p PREFIX    install prefix, defaults to /Users/perry/miniconda3, must not contain spaces.
-s           skip running pre/post-link/install scripts
-u           update an existing installation
-t           run package tests after installation (may install conda-build)


In [3]:
sh ./Miniconda3-latest-MacOSX-x86_64.sh
# sh ./Miniconda3-latest-MacOSX-x86_64.sh -b
Welcome to Miniconda3 4.3.31

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 

Read license (press ENTER many times) then type 'yes'.

The installer adds line to ~/.bash_profile ( -s option prevents this ).

In [7]:
export PATH="$HOME/miniconda3/bin:$PATH"
In [8]:
conda --help
usage: conda [-h] [-V] command ...

conda is a tool for managing and deploying applications, environments and packages.

Options:

positional arguments:
  command
    info         Display information about current conda install.
    help         Displays a list of available conda commands and their help
                 strings.
    list         List linked packages in a conda environment.
    search       Search for packages and display their information. The input
                 is a Python regular expression. To perform a search with a
                 search string that starts with a -, separate the search from
                 the options with --, like 'conda search -- -h'. A * in the
                 results means that package is installed in the current
                 environment. A . means that package is not installed but is
                 cached in the pkgs directory.
    create       Create a new conda environment from a list of specified
                 packages.
    install      Installs a list of packages into a specified conda
                 environment.
    update       Updates conda packages to the latest compatible version. This
                 command accepts a list of package names and updates them to
                 the latest versions that are compatible with all other
                 packages in the environment. Conda attempts to install the
                 newest versions of the requested packages. To accomplish
                 this, it may update some packages that are already installed,
                 or install additional packages. To prevent existing packages
                 from updating, use the --no-update-deps option. This may
                 force conda to install older versions of the requested
                 packages, and it does not prevent additional dependency
                 packages from being installed. If you wish to skip dependency
                 checking altogether, use the '--force' option. This may
                 result in an environment with incompatible packages, so this
                 option must be used with great caution.
    upgrade      Alias for conda update. See conda update --help.
    remove       Remove a list of packages from a specified conda environment.
    uninstall    Alias for conda remove. See conda remove --help.
    config       Modify configuration values in .condarc. This is modeled
                 after the git config command. Writes to the user .condarc
                 file (/Users/perry/.condarc) by default.
    clean        Remove unused packages and caches.
    package      Low-level conda package utility. (EXPERIMENTAL)

optional arguments:
  -h, --help     Show this help message and exit.
  -V, --version  Show the conda version number and exit.

other commands, such as "conda build", are available when additional conda
packages (e.g. conda-build) are installed

In [9]:
# Enable the bioconda 'channel' and some others
conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels bioconda
Warning: 'defaults' already in 'channels' list, moving to the top
Warning: 'conda-forge' already in 'channels' list, moving to the top
Warning: 'bioconda' already in 'channels' list, moving to the top
In [11]:
# This is the config file that was modified by the conda config command. 
# Channels at the bottom take precedence
cat ~/.condarc
channels:
  - bioconda
  - conda-forge
  - defaults
In [14]:
# Install some conda packages
conda install -y seqtk
Fetching package metadata ...............
Solving package specifications: .

Package plan for installation in environment /Users/perry/miniconda3:

The following NEW packages will be INSTALLED:

    seqtk:     1.2-0            bioconda

The following packages will be UPDATED:

    conda:     4.3.31-py36_0             --> 4.3.33-py36_0 conda-forge

The following packages will be SUPERSEDED by a higher-priority channel:

    conda-env: 2.6.0-h36134e3_0          --> 2.6.0-0       conda-forge

conda-env-2.6. 100% |################################| Time: 0:00:00 395.33 kB/s
seqtk-1.2-0.ta 100% |################################| Time: 0:00:00  63.60 kB/s
conda-4.3.33-p 100% |################################| Time: 0:00:01 279.73 kB/s
In [16]:
# samtools version 0.1.15, build number 0
conda install -y samtools=0.1.15=0

# conda install kallisto
# conda install salmon=0.9.1 sailfish
Fetching package metadata ...............
Solving package specifications: .

# All requested packages already installed.
# packages in environment at /Users/perry/miniconda3:
#
samtools                  0.1.15                        0    bioconda
In [17]:
# Take a look at where those packages were installed (default environment 'root')
ls ~/miniconda3/bin
total 5792
drwxr-xr-x  75 perry  staff   2.3K 31 Jan 12:49 .
drwxr-xr-x  13 perry  staff   416B 31 Jan 12:48 ..
-rwxr-xr-x   2 perry  staff   216B 27 Oct 02:51 .python.app-post-link.sh
-rwxr-xr-x   2 perry  staff    39B 27 Oct 02:51 .python.app-pre-unlink.sh
lrwxr-xr-x   1 perry  staff     8B 31 Jan 12:49 2to3 -> 2to3-3.6
-rwxrwxr-x   1 perry  staff   111B 31 Jan 12:49 2to3-3.6
-rwxrwxr-x   2 perry  staff   3.7K 25 Jan 01:56 activate
-rwxr-xr-x   1 perry  staff   5.0K 31 Jan 12:09 c_rehash
lrwxr-xr-x   1 perry  staff     3B 31 Jan 12:48 captoinfo -> tic
-rwxr-xr-x   1 perry  staff   243B 31 Jan 12:10 chardetect
-rwxrwxr-x   2 perry  staff    13K  3 Dec  2016 clear
-rwxrwxr-x   1 perry  staff   132B 31 Jan 12:48 conda
-rwxrwxr-x   1 perry  staff   150B 31 Jan 12:48 conda-env
-rwxrwxr-x   2 perry  staff   3.0K 25 Jan 01:56 deactivate
-rwxr-xr-x   1 perry  staff   252B 31 Jan 12:10 easy_install
-rwxr-xr-x   1 perry  staff   469B 31 Jan 12:10 easy_install-3.6
lrwxr-xr-x   1 perry  staff     7B 31 Jan 12:49 idle3 -> idle3.6
-rwxrwxr-x   1 perry  staff   109B 31 Jan 12:49 idle3.6
-rwxrwxr-x   2 perry  staff    71K  3 Dec  2016 infocmp
lrwxr-xr-x   1 perry  staff     3B 31 Jan 12:48 infotocap -> tic
lrwxr-xr-x   1 perry  staff     2B 31 Jan 12:09 lzcat -> xz
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 lzcmp -> xzdiff
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 lzdiff -> xzdiff
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 lzegrep -> xzgrep
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 lzfgrep -> xzgrep
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 lzgrep -> xzgrep
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 lzless -> xzless
lrwxr-xr-x   1 perry  staff     2B 31 Jan 12:09 lzma -> xz
-rwxr-xr-x   2 perry  staff    14K  8 Nov 09:17 lzmadec
-rwxr-xr-x   2 perry  staff    13K  8 Nov 09:17 lzmainfo
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 lzmore -> xzmore
-rwxrwxr-x   1 perry  staff   5.2K 31 Jan 12:48 ncurses5-config
-rwxrwxr-x   1 perry  staff   5.2K 31 Jan 12:48 ncursesw5-config
-rwxr-xr-x   2 perry  staff   560K  8 Dec 03:05 openssl
-rwxr-xr-x   1 perry  staff   224B 31 Jan 12:10 pip
lrwxr-xr-x   1 perry  staff     8B 31 Jan 12:49 pydoc -> pydoc3.6
lrwxr-xr-x   1 perry  staff     8B 31 Jan 12:49 pydoc3 -> pydoc3.6
-rwxrwxr-x   1 perry  staff    94B 31 Jan 12:49 pydoc3.6
lrwxr-xr-x   1 perry  staff     9B 31 Jan 12:49 python -> python3.6
-rwxr-xr-x   1 perry  staff   133B 31 Jan 12:10 python.app
lrwxr-xr-x   1 perry  staff     9B 31 Jan 12:49 python3 -> python3.6
lrwxr-xr-x   1 perry  staff    17B 31 Jan 12:49 python3-config -> python3.6m-config
-rwxrwxr-x   1 perry  staff    13K 31 Jan 12:49 python3.6
lrwxr-xr-x   1 perry  staff    17B 31 Jan 12:49 python3.6-config -> python3.6m-config
-rwxrwxr-x   1 perry  staff    13K 31 Jan 12:49 python3.6m
-rwxrwxr-x   1 perry  staff   2.0K 31 Jan 12:49 python3.6m-config
-rwxr-xr-x   1 perry  staff   133B 31 Jan 12:10 pythonw
lrwxr-xr-x   1 perry  staff    10B 31 Jan 12:49 pyvenv -> pyvenv-3.6
-rwxrwxr-x   1 perry  staff   451B 31 Jan 12:49 pyvenv-3.6
lrwxr-xr-x   1 perry  staff     4B 31 Jan 12:48 reset -> tset
-rwxrwxr-x   2 perry  staff   391K  7 Oct 04:36 samtools
-rwxr-xr-x   2 perry  staff    59K  8 Jun  2016 seqtk
-rwxr-xr-x   2 perry  staff   1.3M  9 Jun  2016 sqlite3
-rwxrwxr-x   2 perry  staff    18K  3 Dec  2016 tabs
lrwxr-xr-x   1 perry  staff     8B 31 Jan 12:49 tclsh -> tclsh8.5
-rwxrwxr-x   2 perry  staff    12K 27 Jul  2017 tclsh8.5
-rwxrwxr-x   2 perry  staff    80K  3 Dec  2016 tic
-rwxrwxr-x   2 perry  staff    19K  3 Dec  2016 toe
-rwxrwxr-x   2 perry  staff    23K  3 Dec  2016 tput
-rwxrwxr-x   2 perry  staff    28K  3 Dec  2016 tset
lrwxr-xr-x   1 perry  staff     2B 31 Jan 12:09 unlzma -> xz
lrwxr-xr-x   1 perry  staff     2B 31 Jan 12:09 unxz -> xz
-rwxr-xr-x   1 perry  staff   231B 31 Jan 12:10 wheel
lrwxr-xr-x   1 perry  staff     7B 31 Jan 12:49 wish -> wish8.5
-rwxrwxr-x   2 perry  staff    21K 27 Jul  2017 wish8.5
-rwxr-xr-x   2 perry  staff    73K  8 Nov 09:17 xz
lrwxr-xr-x   1 perry  staff     2B 31 Jan 12:09 xzcat -> xz
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 xzcmp -> xzdiff
-rwxr-xr-x   2 perry  staff    14K  8 Nov 09:17 xzdec
-rwxr-xr-x   2 perry  staff   6.5K  8 Nov 09:17 xzdiff
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 xzegrep -> xzgrep
lrwxr-xr-x   1 perry  staff     6B 31 Jan 12:09 xzfgrep -> xzgrep
-rwxr-xr-x   2 perry  staff   5.5K  8 Nov 09:17 xzgrep
-rwxr-xr-x   2 perry  staff   1.8K  8 Nov 09:17 xzless
-rwxr-xr-x   2 perry  staff   2.1K  8 Nov 09:17 xzmore

Using environments

Let's create and switch to a new environment, install some packages, record what we installed, deactivate it.

https://conda.io/docs/user-guide/tasks/manage-environments.html

In [2]:
# Create a new conda environment
conda create -y --name new_env
Fetching package metadata ...............
Solving package specifications: 
Package plan for installation in environment /Users/perry/miniconda3/envs/new_env:

#
# To activate this environment, use:
# > source activate new_env
#
# To deactivate an active environment, use:
# > source deactivate
#

In [3]:
# Activate it explicitly (actually not required after `conda create`)
source activate new_env
(new_env) 

In [4]:
# Install some packages
conda install -y samtools=0.1.14
(new_env) Fetching package metadata ...............
Solving package specifications: .

Package plan for installation in environment /Users/perry/miniconda3/envs/new_env:

The following NEW packages will be INSTALLED:

    ncurses:  5.9-10   conda-forge
    samtools: 0.1.14-0 bioconda   
    zlib:     1.2.8-3  conda-forge

(new_env) 

In [5]:
# By default, environments live under ~/miniconda3/envs
# Take a look
ls ~/miniconda3/envs/new_env/bin
which samtools
(new_env) (new_env) total 1336
drwxr-xr-x  18 perry  staff   576B  1 Feb 15:30 .
drwxr-xr-x   7 perry  staff   224B  1 Feb 15:30 ..
lrwxr-xr-x   1 perry  staff    36B  1 Feb 15:30 activate -> /Users/perry/miniconda3/bin/activate
lrwxr-xr-x   1 perry  staff     3B  1 Feb 15:30 captoinfo -> tic
-rwxrwxr-x   3 perry  staff    13K  3 Dec  2016 clear
lrwxr-xr-x   1 perry  staff    33B  1 Feb 15:30 conda -> /Users/perry/miniconda3/bin/conda
lrwxr-xr-x   1 perry  staff    38B  1 Feb 15:30 deactivate -> /Users/perry/miniconda3/bin/deactivate
-rwxrwxr-x   3 perry  staff    71K  3 Dec  2016 infocmp
lrwxr-xr-x   1 perry  staff     3B  1 Feb 15:30 infotocap -> tic
-rwxrwxr-x   1 perry  staff   5.2K  1 Feb 15:30 ncurses5-config
-rwxrwxr-x   1 perry  staff   5.2K  1 Feb 15:30 ncursesw5-config
lrwxr-xr-x   1 perry  staff     4B  1 Feb 15:30 reset -> tset
-rwxrwxr-x   3 perry  staff   381K  7 Oct 04:39 samtools
-rwxrwxr-x   3 perry  staff    18K  3 Dec  2016 tabs
-rwxrwxr-x   3 perry  staff    80K  3 Dec  2016 tic
-rwxrwxr-x   3 perry  staff    19K  3 Dec  2016 toe
-rwxrwxr-x   3 perry  staff    23K  3 Dec  2016 tput
-rwxrwxr-x   3 perry  staff    28K  3 Dec  2016 tset
(new_env) /Users/perry/miniconda3/envs/new_env/bin/samtools
(new_env) 

In [6]:
# You can export the current environment to an environment.yml
# (For Pythonistas, this functionally similar to a requirements.txt file)
# Keep the environment.yml with your analysis project
conda env export >environment.yml

cat environment.yml
(new_env) (new_env) (new_env) (new_env) (new_env) name: new_env
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- samtools=0.1.14=0
- ncurses=5.9=10
- zlib=1.2.8=3
prefix: /Users/perry/miniconda3/envs/new_env

(new_env) 

In [7]:
# An alternative, if you've like to lock exact package versions with channel + version + build + md5 checksums
# Note that this is now platform specific, but gives better guarantees of a reproducible environment
conda list --show-channel-urls --md5 --explicit >package-list.txt

cat package-list.txt
(new_env) (new_env) (new_env) (new_env) # This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: osx-64
@EXPLICIT
https://conda.anaconda.org/conda-forge/osx-64/ncurses-5.9-10.tar.bz2#f303ad9e588c5f06b9b02077b57d88d5
https://conda.anaconda.org/bioconda/osx-64/samtools-0.1.14-0.tar.bz2#d2d79f5cab9c1c420887875623d26ea9
https://conda.anaconda.org/conda-forge/osx-64/zlib-1.2.8-3.tar.bz2#03b6fcc7a5e1a471e74049665e1c06b0
(new_env) 

In [ ]:
# You can use these files to create new environments with those packages like:

# conda create --name reproduced_env --file environment.yml
# conda create --name locked_reproduced_env --file package-list.txt
In [9]:
# You can recreate the environment somewhere else with
# conda env create -f environment.yml
# One step toward reproducability !

# Leave the environment
source deactivate
(new_env) (new_env) (new_env) (new_env) (new_env) 

What about brew / linuxbrew ?

  • macOS brew and linuxbrew are essentially seperate projects with little cooperation.

  • Anecdotally, brew/linuxbrew bioinformatics installations were often low quality, frequently broken.

homebrew-science is now deprecated

https://github.com/Homebrew/homebrew-science/issues/6365

What about apt, yum, etc

  • Targeted at system-wide packages - typically don't handle non-privileged installations or concurrent versions gracefully, if at all.

  • Official distributions (Debian, Ubuntu, Centos) software repositories rarely keep up to date with recent versions. Unofficial repositories sometimes fill this void (eg Debian Med).

  • Creating packages seems needlessly complex for mere mortals.

What about modules, LMOD etc

  • Well suited to using the shell environment (ie PATH) to manage concurrent versions.

  • LMOD environments can be 'additive' (many 'modules' can be loaded simultaneously, unlike conda environments).

  • LMOD isn't a package manager (doesn't handle download/compilation/installation)

What about pip and virtualenv ?

  • Both come with Python, great for Python packages, large ecosystem of existing packages.
  • Not well suited to non-Python packages (binaries and dependencies).

What about bio-ansible ?

  • bio-ansible is awesome because we wrote it.
  • Not awesome because we have to write every task to install new tools.
    • But! bio-ansible also supports installing conda packages as LMOD modules (we can add anything from Bioconda easily)
  • Allows unprivileged installation of tools in your home directory, and system-wide packages & config.
  • Allows concurrent versions and 'stacking' environments via LMOD modules.
  • Higher barrier to entry for casual users, per-project installs (IMO).

Things I've noticed conda doesn't do well

  • Doesn't officially support 'stacking' environments, ala LMOD.
    • Do we care ? Software is small, disk space is cheap, just make environments with the combinations of tool versions you need.
    • Unofficially, adding max_shlvl: 16 to ~/.condarc allows it (YMMV) (https://github.com/conda/conda/issues/3580).
  • Recipes for building packages (coming up) specify dependency names but not the 'channel' they come from.
  • No streamlined method to install from source (eg conda install https://github.com/me/my_recipe), pre-compiled binary centric ?

Creating (Bio)conda packages

Lets look at the Bioconda recipe for seqtk

https://github.com/bioconda/bioconda-recipes/tree/master/recipes/seqtk

build.sh

#!/bin/bash

export C_INCLUDE_PATH=${PREFIX}/include
export LIBRARY_PATH=${PREFIX}/lib

make all
mkdir -p $PREFIX/bin
cp -f seqtk $PREFIX/bin/

PREFIX is the installation path in the conda build environment (in a configure script you'd do configure --prefix=$PREFIX)

meta.yaml

package:
  name: seqtk
  version: 1.2

source:
  fn: v1.2.tar.gz
  url: https://github.com/lh3/seqtk/archive/v1.2.tar.gz
  md5: 255ffe05bf2f073dc57abcff97f11a37

build:
  number: 0

requirements:
  build:
    - gcc   # [not osx]
    - llvm  # [osx]
    - zlib
  run:
    - zlib


about:
  home: https://github.com/lh3/seqtk
  license: MIT License
  summary: Seqtk is a fast and lightweight tool for processing sequences in the FASTA or FASTQ format

test:
  commands:
    - seqtk seq

Building a recipe (vanilla conda way)

In [25]:
cd ~
mkdir -p recipes/seqtk

# Create your build.sh and meta.yml
# See also: `conda skeleton`, which can help generate templates for specific package types

# vi recipes/seqtk/build.sh
# vi recipes/seqtk/meta.yaml
In [28]:
# We need the conda-build package to ... build packages
conda install -y conda-build
Fetching package metadata ...............
Solving package specifications: .

Package plan for installation in environment /Users/perry/miniconda3:

The following NEW packages will be INSTALLED:

    beautifulsoup4: 4.6.0-py36_0  conda-forge
    conda-build:    2.1.18-py36_0 conda-forge
    conda-verify:   2.0.0-py36_0  conda-forge
    filelock:       2.0.6-py36_0  conda-forge
    jinja2:         2.10-py36_0   conda-forge
    markupsafe:     1.0-py36_0    conda-forge
    pkginfo:        1.4.1-py36_0  conda-forge
    pycrypto:       2.6.1-py36_1  conda-forge
    pyyaml:         3.12-py36_1   conda-forge

beautifulsoup4 100% |################################| Time: 0:00:02  59.83 kB/s
filelock-2.0.6 100% |################################| Time: 0:00:00   3.52 MB/s
markupsafe-1.0 100% |################################| Time: 0:00:00  29.10 kB/s
pkginfo-1.4.1- 100% |################################| Time: 0:00:00  83.65 kB/s
pycrypto-2.6.1 100% |################################| Time: 0:00:05  86.19 kB/s
pyyaml-3.12-py 100% |################################| Time: 0:00:02  70.36 kB/s
conda-verify-2 100% |################################| Time: 0:00:00  62.62 kB/s
jinja2-2.10-py 100% |################################| Time: 0:00:02  76.46 kB/s
conda-build-2. 100% |################################| Time: 0:00:03  81.03 kB/s
In [31]:
# Once a new recipe is created, we can build it
conda build recipes/seqtk/
BUILD START: seqtk-1.2-0
updating index in: /Users/perry/miniconda3/conda-bld/osx-64
updating index in: /Users/perry/miniconda3/conda-bld/noarch

The following NEW packages will be INSTALLED:

    cctools:       895-h7512d6f_0              
    ld64:          274.2-h7c2db76_0            
    libcxx:        4.0.1-h579ed51_0            
    libcxxabi:     4.0.1-hebd6815_0            
    llvm:          4.0.1-hc748206_0            
    llvm-lto-tapi: 4.0.1-h6701bc3_0            
    zlib:          1.2.11-0         conda-forge


WARNING: conda-build appears to be out of date. You have version 2.1.18 but the
latest version is 3.3.0. Run

conda update -n root conda-build

to get the latest version.

Source cache directory is: /Users/perry/miniconda3/conda-bld/src_cache
Downloading source to cache: v1.2.tar.gz
Downloading https://github.com/lh3/seqtk/archive/v1.2.tar.gz
Success
Extracting download
Package: seqtk-1.2-0
source tree in: /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/work/seqtk-1.2
+ source /Users/perry/miniconda3/bin/activate /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac
+ export C_INCLUDE_PATH=/Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include
+ C_INCLUDE_PATH=/Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include
+ export LIBRARY_PATH=/Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib
+ LIBRARY_PATH=/Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib
+ make all
gcc -g -Wall -O2 -Wno-unused-function seqtk.c -o seqtk -lz -lm
+ mkdir -p /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin
+ cp -f seqtk /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin/
INFO:conda_build.build:Packaging seqtk-1.2-0
number of files: 1
Fixing permissions
Fixing linking of @rpath/libz.1.dylib in /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin/seqtk
Fixing linking of /usr/lib/libSystem.B.dylib in /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin/seqtk
install_name_tool -add_rpath @loader_path/../lib/ /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin/seqtk

Fixing permissions
/Users/perry/miniconda3/conda-bld/osx-64/seqtk-1.2-0.tar.bz2
updating index in: /Users/perry/miniconda3/conda-bld
updating index in: /Users/perry/miniconda3/conda-bld/noarch
updating index in: /Users/perry/miniconda3/conda-bld/osx-64
updating: seqtk-1.2-0.tar.bz2
updating index in: /Users/perry/miniconda3/conda-bld
TEST START: /Users/perry/miniconda3/conda-bld/osx-64/seqtk-1.2-0.tar.bz2
Deleting work directory, /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/work/seqtk-1.2

The following NEW packages will be INSTALLED:

    seqtk: 1.2-0    local      
    zlib:  1.2.11-0 conda-forge


WARNING: conda-build appears to be out of date. You have version 2.1.18 but the
latest version is 3.3.0. Run

conda update -n root conda-build

to get the latest version.

+ source /Users/perry/miniconda3/bin/activate /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/_t_env
+ /bin/bash -x -e /Users/perry/miniconda3/conda-bld/seqtk_1517365865334/test_tmp/run_test.sh
+ seqtk seq

Usage:   seqtk seq [options] <in.fq>|<in.fa>

Options: -q INT    mask bases with quality lower than INT [0]
         -X INT    mask bases with quality higher than INT [255]
         -n CHAR   masked bases converted to CHAR; 0 for lowercase [0]
         -l INT    number of residues per line; 0 for 2^32-1 [0]
         -Q INT    quality shift: ASCII-INT gives base quality [33]
         -s INT    random seed (effective with -f) [11]
         -f FLOAT  sample FLOAT fraction of sequences [1]
         -M FILE   mask regions in BED or name list FILE [null]
         -L INT    drop sequences with length shorter than INT [0]
         -c        mask complement region (effective with -M)
         -r        reverse complement
         -A        force FASTA output (discard quality)
         -C        drop comments at the header lines
         -N        drop sequences containing ambiguous bases
         -1        output the 2n-1 reads only
         -2        output the 2n reads only
         -V        shift quality by '(-Q) - 33'
         -U        convert all bases to uppercases
         -S        strip of white spaces in sequences

TEST END: /Users/perry/miniconda3/conda-bld/osx-64/seqtk-1.2-0.tar.bz2
INFO:conda_build.config:--dirty flag and --keep-old-work not specified.Removing build/test folder after successful build/test.

# Automatic uploading is disabled
# If you want to upload package(s) to anaconda.org later, type:

anaconda upload /Users/perry/miniconda3/conda-bld/osx-64/seqtk-1.2-0.tar.bz2

# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes

anaconda_upload is not set.  Not uploading wheels: []
In [32]:
# Where is the package archive we just built ?
conda build recipes/seqtk/ --output
/Users/perry/miniconda3/conda-bld/osx-64/seqtk-1.2-0.tar.bz2
In [34]:
# Install the locally built package from the Conda build cache (the 'local' channel)
conda install -y --use-local seqtk

# or just using the package tar.bz2 directly, or an http:// link where it is hosted
# conda install /Users/perry/miniconda3/conda-bld/osx-64/seqtk-1.2-0.tar.bz2
# conda install http://bioinformatics.erc.monash.edu/home/andrewperry/conda/seqtk-1.2-0.tar.bz2
Fetching package metadata .................
Solving package specifications: .

Package plan for installation in environment /Users/perry/miniconda3:

The following NEW packages will be INSTALLED:

    seqtk: 1.2-0 local

Distributing your build on Anaconda.org

(on a personal conda channel, independently of the Bioconda project / channel)

Step 1: Create an account at https://anaconda.org/

In [ ]:
# Step 2: Install the `anaconda-client` package
conda install anaconda-client

# Step 3: Login and upload
anaconda login
# use the path to the package reported by `conda build recipes/seqtk/ --output`
anaconda upload <path_to_package_bz2>

# Step 4: Test that it worked - install from the channel you uploaded to
conda uninstall bigdatascript
conda install -c https://conda.anaconda.org/pansapiens bigdatascript

The Bioconda way

http://bioconda.github.io/contributing.html

Adding a recipe and testing locally before making a Pull Request.

First step - go to https://github.com/bioconda/bioconda-recipes and fork the repo.

Then clone your fork

export MY_GIT_USERNAME=pansapiens
git clone https://github.com/${MY_GIT_USERNAME}/bioconda-recipes.git
cd bioconda-recipes

Create a new branch for your recipe.

git branch mynewtool
git checkout mynewtool

Edit your recipe. Using a similar existing recipe as a template to modify it is often a good stratgy. (You can also use conda skeleton).

vi recipes/mynewtool/meta.yaml
vi recipes/mynewtool/build.sh

git commit -a -m "Added new recipe for mynewtool."

Simulate the TravisCI environment to do a test build

# This Bioconda script creates a fresh Miniconda install, similar to the Bioconda Travis CI
./simulate-travis.py --bootstrap /tmp/anaconda --overwrite

# Build your recipe and run tests.
# --packages is optional, only recipes where version and build have changed are built (?)
./simulate-travis.py --disable-docker --packages mynewtool --force

If tests passed, you can now squash your commits, push the branch

git push origin
  • Go to https://github.com/bioconda/bioconda-recipes and make a Pull Request for your branch
  • TravisCI will automatically build your branch.
  • If TravisCI tests pass, the Bioconda team will review your PR and if it's okay, merge it
  • Recipes in the Bioconda master branch are automatically built on Linux and macOS (via TravisCI) and uploaded to the Anaconda bioconda channel.

Thanks !