Conda bioconda

From wiki
Revision as of 14:32, 23 October 2018 by PeterThorpe (talk | contribs) (conda stuff)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

users run once: install-bioconda

This does the following: Installl a per user version of conda with extra channels. It then puts it in the bash_rc so it can be run with single commands. This script live in /mnt/apps/

 > more install-bioconda
#!/bin/bash

INSTALLER=/tmp/$USER-miniconda.sh

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $INSTALLER

# this is an install of python 2.7.15. Cannot yum install as broken. So a compiled version is here.
# if the old 2.6 default /usr/bin version is needed we need to alter this approach
export PATH=/mnt/apps/Python/bin/:$PATH

sh $INSTALLER -b -p /shelf/apps/$USER/conda -f

rm $INSTALLER

echo "# folling 3 lines are for conda install. Auto done with install-bioconda" >> /storage/home/users/$USER/.bashrc
echo ". /shelf/apps/$USER/conda/etc/profile.d/conda.sh" >> /storage/home/users/$USER/.bashrc
echo "conda activate" >> /storage/home/users/$USER/.bashrc
echo "conda deactivate" >> /storage/home/users/$USER/.bashrc

source /storage/home/users/$USER/.bashrc

conda config --add channels R
conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels bioconda

#echo "INFO:
#echo "you will have to log out and back in again for this to work. "
#echo "Or run:"
#echo "      source ~/.bashrc"
#echo "We strongly advise using envs: https://conda.io/docs/user-guide/tasks/manage-environments.html"
#echo "installing packages: https://bioconda.github.io/recipes.html"

on login each user get a apps folder on /shelf

It was decided to use shelf so the users main storage does not get filled up too fast. This runs for each user up on login:

> more /etc/profile.d/apps.sh
#!/bin/bash

# make a symlink to the in /ect/profile.d

alias qstat='qstat -u \*'

# Ensure all normal users get a personal apps directory
# normal users have an id greater than 1000
if [ `id -u` -gt 999 ]; then
  mkdir -p /shelf/apps/$USER/apps/
  export APPS=/shelf/apps/$USER/apps/
fi

#export PATH=/mnt/apps/openmpi/3.0.0/bin/:$PATH

if [ `id -u` -gt 999 ]; then
  #export PATH=/mnt/apps/Python/bin/:$PATH
  export PATH=/mnt/apps/:$PATH
fi

#export PATH=/mnt/apps/singularity/2.5.1/bin/:$PATH

#export PATH=/opt/sge/greenify/:$PATH


how to use conda

1) Conda. THIS IS THE FUTURE. We highly recommend this:

We are testing Bioconda on Marvin on a per user basis, so you have total control over it. Would you please be our first actual user test? The default python in /usr/bin is python 2.6 which is too old. As a warning, running the following will update this to 2.7 and 3.7. So, only do so if you do not specifically require the python 2.6 version for your other work. Although, you could set up a conda environment with 2.6 if you really wanted. I can’t think of anything that requires 2.6.

1) Log in and from the command line type (only do this once!):

install-bioconda

2) Either log out and back in or type: source ~/.bashrc

3) We strongly advise using environments: https://conda.io/docs/user-guide/tasks/manage-environments.html . You can do this in many ways. Please see the link for more details (here you can specifiy eact version etc ..). The easiest usage would be: e.g. conda create -n NAME_OF_ENV PACKAGE_TO_INSTALL (pick a package you are interested in from here: installing packages: https://bioconda.github.io/recipes.html ). Roary is a package name as an example.

conda create -n roary roary

conda activate roary

conda update roary


You are now ready to use this package.

Conda deactivate to leave this environment.


This works for me and a test user. But may fail for you, so be patient with us.

To list all the environments you have created:

conda info –envs

installing packages: https://bioconda.github.io/recipes.html