-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
57 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
FROM ubuntu:16.04 as builder | ||
FROM ubuntu:20.04 as builder | ||
|
||
USER root | ||
|
||
ARG VER_HTSLIB="1.9" | ||
# ALL tool versions used by opt-build.sh | ||
# need to keep in sync with setup.sh | ||
ARG VER_HTSLIB="1.10.2" | ||
ARG VER_LIBBW="0.4.2" | ||
|
||
ENV OPT /opt/wtsi-cgp | ||
|
@@ -11,24 +13,23 @@ ENV LD_LIBRARY_PATH $OPT/lib | |
ENV LC_ALL C | ||
|
||
RUN apt-get -yq update | ||
RUN apt-get install -yq --no-install-recommends\ | ||
build-essential\ | ||
apt-transport-https\ | ||
curl\ | ||
ca-certificates\ | ||
make\ | ||
bzip2\ | ||
gcc\ | ||
libtasn1-dev\ | ||
libgnutls-dev\ | ||
nettle-dev\ | ||
libgmp-dev\ | ||
libp11-kit-dev\ | ||
zlib1g-dev\ | ||
libbz2-dev\ | ||
liblzma-dev\ | ||
libcurl4-gnutls-dev\ | ||
libncurses5-dev | ||
RUN apt-get install -yq --no-install-recommends build-essential | ||
RUN apt-get install -yq --no-install-recommends apt-transport-https | ||
RUN apt-get install -yq --no-install-recommends curl | ||
RUN apt-get install -yq --no-install-recommends ca-certificates | ||
RUN apt-get install -yq --no-install-recommends make | ||
RUN apt-get install -yq --no-install-recommends bzip2 | ||
RUN apt-get install -yq --no-install-recommends gcc | ||
RUN apt-get install -yq --no-install-recommends libtasn1-dev | ||
RUN apt-get install -yq --no-install-recommends nettle-dev | ||
RUN apt-get install -yq --no-install-recommends libgmp-dev | ||
RUN apt-get install -yq --no-install-recommends libp11-kit-dev | ||
RUN apt-get install -yq --no-install-recommends zlib1g-dev | ||
RUN apt-get install -yq --no-install-recommends libbz2-dev | ||
RUN apt-get install -yq --no-install-recommends liblzma-dev | ||
RUN apt-get install -yq --no-install-recommends libcurl4-gnutls-dev | ||
RUN apt-get install -yq --no-install-recommends libncurses5-dev | ||
RUN apt-get install -yq --no-install-recommends libgnutls28-dev | ||
|
||
RUN mkdir -p $OPT/bin | ||
|
||
|
@@ -40,11 +41,11 @@ RUN bash build/opt-build.sh $OPT | |
COPY . . | ||
RUN bash build/opt-build-local.sh $OPT | ||
|
||
FROM ubuntu:16.04 | ||
FROM ubuntu:20.04 | ||
|
||
LABEL maintainer="[email protected]"\ | ||
uk.ac.sanger.cgp="Cancer, Ageing and Somatic Mutation, Wellcome Sanger Institute" \ | ||
version="1.2.0" \ | ||
version="1.3.0" \ | ||
description="cgpBigWig" | ||
|
||
ENV OPT /opt/wtsi-cgp | ||
|
@@ -61,6 +62,7 @@ bzip2 \ | |
zlib1g \ | ||
liblzma5 \ | ||
libncurses5 \ | ||
libcurl3-gnutls \ | ||
unattended-upgrades && \ | ||
unattended-upgrade -d -v && \ | ||
apt-get remove -yq unattended-upgrades && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.1.0 | ||
1.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
########## LICENSE ########## | ||
# Copyright (c) 2016 Genome Research Ltd. | ||
# Copyright (c) 2016-2020 Genome Research Ltd. | ||
# | ||
# Author: Cancer Genome Project [email protected] | ||
# | ||
|
@@ -32,147 +32,41 @@ | |
# | ||
########################### | ||
|
||
# for bamstats | ||
SOURCE_HTSLIB="https://github.com/samtools/htslib/releases/download/1.7/htslib-1.7.tar.bz2" | ||
#libBigWig - bigwig access library | ||
SOURCE_LIB_BW="https://github.com/dpryan79/libBigWig/archive/0.4.2.tar.gz" | ||
|
||
get_distro () { | ||
EXT="" | ||
if [[ $2 == *.tar.bz2* ]] ; then | ||
EXT="tar.bz2" | ||
elif [[ $2 == *.zip* ]] ; then | ||
EXT="zip" | ||
elif [[ $2 == *.tar.gz* ]] ; then | ||
EXT="tar.gz" | ||
else | ||
echo "I don't understand the file type for $1" | ||
exit 1 | ||
fi | ||
if hash curl 2>/dev/null; then | ||
curl -sS -o $1.$EXT -L $2 | ||
else | ||
wget -nv -O $1.$EXT $2 | ||
fi | ||
} | ||
|
||
get_file () { | ||
# output, source | ||
if hash curl 2>/dev/null; then | ||
curl -sS -o $1 -L $2 | ||
else | ||
wget -nv -O $1 $2 | ||
fi | ||
} | ||
|
||
if [ "$#" -ne "1" ] ; then | ||
echo "Please provide an installation path such as /opt/ICGC" | ||
exit 0 | ||
fi | ||
|
||
CPU=1 | ||
ls /proc/cpuinfo >& /dev/null # very noddy attempt to figure out thread count | ||
if [ $? -eq 0 ]; then | ||
CPU=`grep -c ^processor /proc/cpuinfo` | ||
else | ||
CPU=`sysctl -a | grep machdep.cpu | grep thread_count | awk '{print $2}'` | ||
if [ $? -ne 0 ]; then | ||
# fall back to unthreaded core test | ||
CPU=`sysctl -a | grep machdep.cpu | grep core_count | awk '{print $2}'` | ||
fi | ||
fi | ||
if [ "$CPU" -gt "6" ]; then | ||
CPU=6 | ||
# ALL tool versions used by opt-build.sh | ||
# need to keep in sync with Dockerfile | ||
export VER_HTSLIB="1.10.2" | ||
export VER_LIBBW="0.4.2" | ||
|
||
if [[ ($# -ne 1 && $# -ne 2) ]] ; then | ||
echo "Please provide an installation path and optionally perl lib paths to allow, e.g." | ||
echo " ./setup.sh /opt/myBundle" | ||
echo "OR all elements versioned:" | ||
echo " ./setup.sh /opt/cgpPinel-X.X.X /opt/cgpVcf-X.X.X/lib/perl:/opt/PCAP-core-X.X.X/lib/perl" | ||
exit 1 | ||
fi | ||
echo "Max compilation CPUs set to $CPU" | ||
|
||
set -e | ||
|
||
INST_PATH=$1 | ||
|
||
if [[ $# -eq 2 ]] ; then | ||
CGP_PERLLIBS=$2 | ||
fi | ||
|
||
# get current directory | ||
INIT_DIR=`pwd` | ||
|
||
set -e | ||
|
||
# cleanup inst_path | ||
mkdir -p $INST_PATH | ||
mkdir -p $INST_PATH/bin | ||
cd $INST_PATH | ||
INST_PATH=`pwd` | ||
mkdir -p $INST_PATH/bin | ||
cd $INIT_DIR | ||
|
||
#create a location to build dependencies | ||
SETUP_DIR=$INIT_DIR/install_tmp | ||
mkdir -p $SETUP_DIR | ||
|
||
echo -n "Get htslib ..." | ||
if [ -e $SETUP_DIR/htslibGet.success ]; then | ||
echo " already staged ..."; | ||
else | ||
echo | ||
cd $SETUP_DIR | ||
get_distro "htslib" $SOURCE_HTSLIB | ||
touch $SETUP_DIR/htslibGet.success | ||
fi | ||
|
||
echo -n "Building htslib ..." | ||
if [ -e $SETUP_DIR/htslib.success ]; then | ||
echo " previously installed ..."; | ||
else | ||
echo | ||
cd $SETUP_DIR | ||
mkdir -p htslib | ||
tar --strip-components 1 -C htslib -jxf htslib.tar.bz2 | ||
cd htslib | ||
./configure --enable-plugins --enable-libcurl --prefix=$INST_PATH | ||
make -j$CPU | ||
make install | ||
rm -f $INST_PATH/lib/libhts.so* | ||
cd $SETUP_DIR | ||
touch $SETUP_DIR/htslib.success | ||
fi | ||
|
||
cd $INIT_DIR | ||
|
||
echo -n "Building libBigWig ..." | ||
if [ -e $SETUP_DIR/libBigWig.success ]; then | ||
echo -n " previously installed ..."; | ||
else | ||
cd $SETUP_DIR | ||
get_distro "libBigWig" $SOURCE_LIB_BW | ||
mkdir -p libBigWig | ||
tar --strip-components 1 -C libBigWig -zxf libBigWig.tar.gz | ||
make -C libBigWig -j$CPU install prefix=$INST_PATH | ||
rm -f $INST_PATH/lib/libBigWig.so | ||
touch $SETUP_DIR/libBigWig.success | ||
fi | ||
echo | ||
|
||
export HTSLIB="$SETUP_DIR/htslib" | ||
cd $INIT_DIR | ||
|
||
|
||
echo -n "Building cgpBigWig ..." | ||
if [ -e $SETUP_DIR/cgpBigWig.success ]; then | ||
echo -n " previously installed ..."; | ||
else | ||
cd $INIT_DIR | ||
make -C c clean | ||
make -C c -j$CPU prefix=$INST_PATH HTSLIB=$SETUP_DIR/htslib | ||
cp bin/bam2bedgraph $INST_PATH/bin/. | ||
cp bin/bwjoin $INST_PATH/bin/. | ||
cp bin/bam2bw $INST_PATH/bin/. | ||
cp bin/bwcat $INST_PATH/bin/. | ||
cp bin/bam2bwbases $INST_PATH/bin/. | ||
cp bin/bg2bw $INST_PATH/bin/. | ||
cp bin/detectExtremeDepth $INST_PATH/bin/. | ||
touch $SETUP_DIR/cgpBigWig.success | ||
# need to clean up as will clash with other version | ||
make -C c clean | ||
fi | ||
echo | ||
#add bin path for install tests | ||
export PATH=$INST_PATH/bin:$PATH | ||
|
||
# cleanup all junk | ||
rm -rf $SETUP_DIR | ||
bash build/opt-build.sh $INST_PATH | ||
bash build/opt-build-local.sh $INST_PATH | ||
|
||
echo | ||
echo | ||
|