Setting up Bioconda

Probably the easiest (but not the only) way to install some external tools required by PacBio Data Processing, like pbindex, the aligner or ccs, is through conda. If you decide to follow this route, this section can hopefully help you.

The complete instructions can be found in PacBio & Bioconda and the links therein, but they basically amount to:

  1. Install conda. See installing conda for full details, but it is probably enough to use Miniconda, a minimal conda installer. In that case we will assume, as an example, that the conda environment is installed in a directory called:

    /home/dave/miniconda3
    

    Warning

    Depending on the choices made during the process of installing Miniconda you may allow the installer to configure your shell such that it always activates the conda environment at login time. If that is the case, and you are using Bash, you will find in your Bash initialization file , ~/.bashrc, a block similar to the following one:

    # >>> conda initialize >>>
    # !! Contents within this block are managed by 'conda init' !!
    __conda_setup="$('/home/dave/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
    if [ $? -eq 0 ]; then
        eval "$__conda_setup"
    else
        if [ -f "/home/dave/miniconda3/etc/profile.d/conda.sh" ]; then
            . "/home/dave/miniconda3/etc/profile.d/conda.sh"
        else
             export PATH="/home/dave/miniconda3/bin:$PATH"
        fi
    fi
    unset __conda_setup
    # <<< conda initialize <<<
    

    Since we are using the conda environment in a very limited way, you can comment that block, prepending a # to each line.

  2. Setup the channels in the conda environment just created as described in Bioconda.

  3. DO NOT run conda update --all. The PacBio & Bioconda site strongly advises to do it, but that results in an environment where pbindex, an aligner and ccs cannot be installed.

Obviously, for the purpose of having PacBio Data Processing up and running, it is not necessary to install multiple conda environments to have pbindex, an aligner and ccs. The three tools can be installed in the same conda environment.

Using a conda environment

In some regards, a conda environment is very similar to a normal Python virtual environment. This implies, as explained before, that you don’t need to create one conda environment for each package.

Apart from the instructions to deactivate the environment, what follows is applicable to both conda environments and Python virtual environments.

To implicitly operate on a given conda environment, as it happens with Python virtual environments, it must be activated.

Once the environment is created, if can be activated with (using the same example as before):

$ source /home/dave/miniconda3/bin/activate

and the executables installed in it are visible without further ado. Just type the name of the executable inside the environment to run it. For instance, you would invoke the ccs executable simply typing it.

To deactivate a conda environment, run:

$ conda deactivate

However the activate/deactivate dance is not necessary if all you want is to simply leverage one executable installed in a given conda/virtual environment. Say that you want to run an executable called great-tool installed in the conda environment that we created under /home/dave/miniconda3. It could be pbmm2, pbindex or ccs, for instance. With or without activating the environment, the command can be called giving its full path. This line:

$ /home/dave/miniconda3/bin/great-tool

would run the executable of interest.