Skip to content

Instantly share code, notes, and snippets.

@thanhleviet
Created December 24, 2020 14:04
Show Gist options
  • Save thanhleviet/f898c644ca4b58e72175018c01a52ba3 to your computer and use it in GitHub Desktop.
Save thanhleviet/f898c644ca4b58e72175018c01a52ba3 to your computer and use it in GitHub Desktop.
Sigularity def for Pangolin https://github.com/cov-lineages/pangolin
Bootstrap: docker
From: ubuntu:xenial
%labels
Author: Thanh Le Viet
Software: pangolin
Description: "Pangolin: Software package for assigning SARS-CoV-2 genome sequences to global lineages"
Notes: "This singularity definition is based on https://github.com/StaPH-B/docker-builds"
# ENV PANGOLIN_VERSION "2.0.1"
# ENV PANGOLIN_LEARN_VERSION "2020-07-20"
# LABEL base.image="ubuntu:xenial"
# LABEL dockerfile.version="1"
# LABEL software="pangolin"
# LABEL software.version=${PANGOLIN_VERSION}
# LABEL description="Conda environment for Pangolin. Pangolin: Software package for assigning SARS-CoV-2 genome sequences to global lineages."
# LABEL website="https://github.com/hCoV-2019/pangolin"
# LABEL license="GNU General Public License v3.0"
# LABEL license.url="https://github.com/hCoV-2019/pangolin/blob/master/LICENSE.txt"
# LABEL maintainer="Erin Young"
# LABEL maintainer.email="[email protected]"
%setup
# set the environment
%files
%environment
export PATH="/miniconda/envs/pangolin/bin:$PATH"
export LC_ALL=C
%post
PANGOLIN_VERSION="2.1.2"
PANGOLIN_LEARN_VERSION="2020-07-20"
export LC_ALL=C
export ROOT_CONDA="/miniconda"
export PATH="${ROOT_CONDA}/bin:$PATH"
# install needed software for conda install
apt-get update && apt-get install -y \
wget \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
cd /opt
# get miniconda and the pangolin repo
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh &&\
bash ./Miniconda3-latest-Linux-x86_64.sh -p /miniconda -b &&\
rm Miniconda3-latest-Linux-x86_64.sh &&\
conda install -c conda-forge mamba
wget https://github.com/cov-lineages/pangolin/archive/v${PANGOLIN_VERSION}.tar.gz &&\
tar -xf v${PANGOLIN_VERSION}.tar.gz &&\
mv pangolin-${PANGOLIN_VERSION} pangolin
# create the conda environment and set as default
conda env create -f pangolin/environment.yml
echo "source activate pangolin" > /etc/bash.bashrc
conda clean --all -y
export PYTHON="/miniconda/envs/pangolin/bin/python"
export PATH="/miniconda/envs/pangolin/bin:$PATH"
cd pangolin && \
$PYTHON setup.py install
# install and update pangolin learn
# do it here to allow for caching of the previous layers
#Just install latest update
$PYTHON -m pip install git+https://github.com/cov-lineages/pangoLEARN.git
$PYTHON -m pip install git+https://github.com/cov-lineages/lineages.git
%test
export PATH="/miniconda/envs/pangolin/bin:$PATH"
pangolin -v && pangolin -lv && pangolin -pv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment