Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Sep 19, 2019
2 parents 8ae83be + 2b38f57 commit 8f846ed
Show file tree
Hide file tree
Showing 8 changed files with 269 additions and 52 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/LICENCE
/README.md
/INSTALL.md
/LICENCE
/CHANGES.md
/.gitignore
/.git
55 changes: 15 additions & 40 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,21 @@ notifications:
slack: wtsi-cgpit:ptUMR1tkNyZJYd9TpGoss8WR
email: false

env:
- CC=gcc
sudo: false

language:
- c

dist: trusty

addons:
apt:
packages:
- build-essential
- curl
- libcurl4-openssl-dev
- libssl-dev
- nettle-dev
- zlib1g-dev
- libbz2-dev
- liblzma-dev

install: true
services:
- docker

script:
- ./setup.sh ~/wtsi-opt

matrix:
include:
- #Trusty
compiler: gcc
os: linux
sudo: required
- #Trusty
compiler: clang
os: linux
sudo: required
- dist: precise
compiler: gcc
os: linux
sudo: required
- dist: precise
compiler: clang
os: linux
sudo: required
- set -e
- echo 'Build and check docker image'
- docker build -t cgpbigwig .
- docker images | grep -c cgpbigwig
- echo 'Verify program(s) from this repo'
- docker run -t --rm cgpbigwig bam2bedgraph --version
- docker run -t --rm cgpbigwig bwjoin --version
- docker run -t --rm cgpbigwig bam2bw --version
- docker run -t --rm cgpbigwig bwcat --version
- docker run -t --rm cgpbigwig bam2bwbases --version
- docker run -t --rm cgpbigwig bg2bw --version
- docker run -t --rm cgpbigwig detectExtremeDepth --version
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGES

## 1.1.0

Add docker build to allow internal large CI system to process. dockstore-cgpbigwig will
be modified to base from here and only contain additional helpers and CWL.

## 1.0.4

* Add checks to sam_iter_next to ensure result is checked for errors
Expand All @@ -14,7 +19,7 @@
* Where a proper pair filter is used, now check for the correct paired-end orientation of F/R.
* If this is not met the read is ignored
* Added a -f filter of flags to **include** alongside the existing -F for exclude as per samtools style filtering for `bam2bw`, `bam2bwbases` and `bam2bedgraph`
* **NB this flag was used as the exclude in `bam2bedgraph`. The flags have now been switched.**
* **NB this flag was used as the exclude in `bam2bedgraph`. The flags have now been switched.**

## 1.0.2

Expand Down
78 changes: 78 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
FROM ubuntu:16.04 as builder

USER root

ARG VER_HTSLIB="1.9"
ARG VER_LIBBW="0.4.2"

ENV OPT /opt/wtsi-cgp
ENV PATH $OPT/bin:$PATH
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 mkdir -p $OPT/bin

WORKDIR /install_tmp

ADD build/opt-build.sh build/
RUN bash build/opt-build.sh $OPT

COPY . .
RUN bash build/opt-build-local.sh $OPT

FROM ubuntu:16.04

LABEL maintainer="[email protected]"\
uk.ac.sanger.cgp="Cancer, Ageing and Somatic Mutation, Wellcome Sanger Institute" \
version="1.1.0" \
description="cgpBigWig"

ENV OPT /opt/wtsi-cgp
ENV PATH $OPT/bin:$PATH
ENV LD_LIBRARY_PATH $OPT/lib
ENV LC_ALL C

RUN apt-get -yq update
RUN apt-get install -yq --no-install-recommends \
apt-transport-https \
curl \
ca-certificates \
bzip2 \
zlib1g \
liblzma5 \
libncurses5 \
unattended-upgrades && \
unattended-upgrade -d -v && \
apt-get remove -yq unattended-upgrades && \
apt-get autoremove -yq

RUN mkdir -p $OPT
COPY --from=builder $OPT $OPT

## USER CONFIGURATION
RUN adduser --disabled-password --gecos '' ubuntu && chsh -s /bin/bash && mkdir -p /home/ubuntu

USER ubuntu
WORKDIR /home/ubuntu

CMD ["/bin/bash"]
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

Package of C scripts for generation of [BigWig][BigWig] coverage files

[![Quay Badge][quay-status]][quay-repo]

| Master | Dev |
|-----------------------------------------------|----------------------------------------------|
| [![Master Badge][travis-master]][travis-base] | [![Dev Badge][travis-develop]][travis-base] |

<!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->

- [Installation](#installation)
- [Docker and Singularity](#docker-and-singularity)
- [Programs](#programs)
- [bwcat](#bwcat)
- [bwjoin](#bwjoin)
- [bam2bw](#bam2bw)
- [bg2bw](#bg2bw)
- [bam2bwbases](#bam2bwbases)
- [bam2bedgraph](#bam2bedgraph)
- [License](#license)
* [Installation](#installation)
* [Docker and Singularity](#docker-and-singularity)
* [Programs](#programs)
* [bwcat](#bwcat)
* [bwjoin](#bwjoin)
* [bam2bw](#bam2bw)
* [bg2bw](#bg2bw)
* [bam2bwbases](#bam2bwbases)
* [bam2bedgraph](#bam2bedgraph)
* [License](#license)

<!-- /TOC -->

Expand All @@ -38,6 +40,8 @@ To install this package run:

## Docker and Singularity

A docker image for this tool can be found at [quay.io][quay-repo] (this may be more current than the dockstore version).

There are [docker][quay.io] and [dockstore.org][dockstore] wrappers for this project at [dockstore-cgpbigwig] including CWL bindings.

See the [dockstore-cgpbigwig] documentation for more detail.
Expand Down Expand Up @@ -204,3 +208,8 @@ identical to a statement that reads ‘Copyright (c) 2005, 2006, 2007, 2008,
[travis-master]: https://travis-ci.org/cancerit/cgpBigWig.svg?branch=master
[travis-develop]: https://travis-ci.org/cancerit/cgpBigWig.svg?branch=develop
[travis-base]: https://travis-ci.org/cancerit/cgpBigWig

<!-- Quay.io -->
[quay-status]: https://quay.io/repository/wtsicgp/cgpbigwig/status
[quay-repo]: https://quay.io/repository/wtsicgp/cgpbigwig
[quay-builds]: https://quay.io/repository/wtsicgp/cgpbigwig?tab=builds
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.1.0
60 changes: 60 additions & 0 deletions build/opt-build-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

set -ex

if [[ -z "${TMPDIR}" ]]; then
TMPDIR=/tmp
fi

set -u

if [ "$#" -lt "1" ] ; then
echo "Please provide an installation path such as /opt/ICGC"
exit 1
fi

# get path to this script
SCRIPT_PATH=`dirname $0`;
SCRIPT_PATH=`(cd $SCRIPT_PATH && pwd)`

# get the location to install to
INST_PATH=$1
mkdir -p $1
INST_PATH=`(cd $1 && pwd)`
echo $INST_PATH

# get current directory
INIT_DIR=`pwd`

CPU=`grep -c ^processor /proc/cpuinfo`
if [ $? -eq 0 ]; then
if [ "$CPU" -gt "6" ]; then
CPU=6
fi
else
CPU=1
fi
echo "Max compilation CPUs set to $CPU"

mkdir -p $INST_PATH/bin

# make sure tools installed can see the install loc of libraries
set +u
export LD_LIBRARY_PATH=`echo $INST_PATH/lib:$LD_LIBRARY_PATH | perl -pe 's/:\$//;'`
export PATH=`echo $INST_PATH/bin:$PATH | perl -pe 's/:\$//;'`
export MANPATH=`echo $INST_PATH/man:$INST_PATH/share/man:$MANPATH | perl -pe 's/:\$//;'`
set -u

##### cgpBigWig installation
make -C c clean
make -C c -j$CPU prefix=$INST_PATH HTSLIB=$INST_PATH/lib
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/.
make -C c clean

cd $HOME
83 changes: 83 additions & 0 deletions build/opt-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/bin/bash

set -ex

if [[ -z "${TMPDIR}" ]]; then
TMPDIR=/tmp
fi

set -u

if [ "$#" -lt "1" ] ; then
echo "Please provide an installation path such as /opt/ICGC"
exit 1
fi

# get path to this script
SCRIPT_PATH=`dirname $0`;
SCRIPT_PATH=`(cd $SCRIPT_PATH && pwd)`

# get the location to install to
INST_PATH=$1
mkdir -p $1
INST_PATH=`(cd $1 && pwd)`
echo $INST_PATH

# get current directory
INIT_DIR=`pwd`

CPU=`grep -c ^processor /proc/cpuinfo`
if [ $? -eq 0 ]; then
if [ "$CPU" -gt "6" ]; then
CPU=6
fi
else
CPU=1
fi
echo "Max compilation CPUs set to $CPU"


SETUP_DIR=$INIT_DIR/install_tmp
mkdir -p $SETUP_DIR/distro # don't delete the actual distro directory until the very end
mkdir -p $INST_PATH/bin
cd $SETUP_DIR


# make sure tools installed can see the install loc of libraries
set +u
export LD_LIBRARY_PATH=`echo $INST_PATH/lib:$LD_LIBRARY_PATH | perl -pe 's/:\$//;'`
export PATH=`echo $INST_PATH/bin:$PATH | perl -pe 's/:\$//;'`
export MANPATH=`echo $INST_PATH/man:$INST_PATH/share/man:$MANPATH | perl -pe 's/:\$//;'`
set -u

##### DEPS for cgpBigWig #####

## HTSLIB (tar.bz2)
if [ ! -e $SETUP_DIR/htslib.success ]; then
rm -rf htslib
mkdir -p htslib
curl -sSL --retry 10 https://github.com/samtools/htslib/releases/download/${VER_HTSLIB}/htslib-${VER_HTSLIB}.tar.bz2 > distro.tar.bz2
tar --strip-components 1 -C htslib -jxf distro.tar.bz2
cd htslib
./configure --enable-plugins --enable-libcurl --prefix=$INST_PATH
make clean
make -j$CPU
make install
cd $SETUP_DIR
rm -rf distro.*
touch $SETUP_DIR/htslib.success
fi

## LIB-BW (tar.gz)
if [ ! -e $SETUP_DIR/libBigWig.success ]; then
curl -sSL --retry 10 https://github.com/dpryan79/libBigWig/archive/${VER_LIBBW}.tar.gz > distro.tar.gz
rm -rf distro/*
tar --strip-components 1 -C distro -xzf distro.tar.gz
make -C distro clean
make -C distro -j$CPU install prefix=$INST_PATH
rm -rf distro.* distro/*
touch $SETUP_DIR/libBigWig.success
fi

cd $HOME
rm -rf $SETUP_DIR

0 comments on commit 8f846ed

Please sign in to comment.