Skip to content

Commit

Permalink
Merge pull request #44 from ICGC-TCGA-PanCancer/dev
Browse files Browse the repository at this point in the history
v1.1.1
  • Loading branch information
keiranmraine committed Jun 27, 2014
2 parents db8d54f + be9b210 commit 757d117
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 72 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin/bam_stats.pl
bin/bam_to_sra_sub.pl
bin/build_biobambam_relocatable.sh
bin/bwa_aln.pl
bin/bwa_mem.pl
bin/cpanm
Expand Down
5 changes: 3 additions & 2 deletions MYMETA.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@
"Sub::Exporter::Progressive" : "0.001011",
"Term::UI" : "0.42",
"Test::Fatal" : "0.013",
"Try::Tiny" : "0.19"
"Try::Tiny" : "0.19",
"XML::Simple" : "2.2"
}
}
},
"release_status" : "stable",
"version" : "v1.1.0"
"version" : "v1.1.1"
}
3 changes: 2 additions & 1 deletion MYMETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ requires:
Term::UI: 0.42
Test::Fatal: 0.013
Try::Tiny: 0.19
version: v1.1.0
XML::Simple: 2.2
version: v1.1.1
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ WriteMakefile(
'Pod::Coverage' => 0.23,
'Term::UI' => 0.42, # currently in core but scheduled for removal 5.17, no alternative recommended
'Sub::Exporter::Progressive' => 0.001011,
'XML::Simple' => 2.20,
}
);

Expand Down
124 changes: 124 additions & 0 deletions bin/build_biobambam_relocatable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#! /bin/bash
LIBMAUSVERSION=0.0.130-release-20140618101704
BIOBAMBAMVERSION=0.0.148-release-20140618101902
SNAPPYVERSION=1.1.1
IOLIBVERSION=1.13.7
CHRPATHVERSION=0.16
BUILDDIR=${PWD}
INSTALLDIR=${BUILDDIR}/install-dir
TOOLSDIR=${BUILDDIR}/tools-dir
PAR=`cat /proc/cpuinfo | egrep "^processor" | wc -l`

# get chrpath
if [ ! -f chrpath-${CHRPATHVERSION}.tar.gz ] ; then
wget -O - "https://alioth.debian.org/frs/download.php/file/3979/chrpath-${CHRPATHVERSION}.tar.gz" > chrpath-${CHRPATHVERSION}.tar.gz
fi

# get iolib
if [ ! -f io_lib-${IOLIBVERSION}.tar.gz ] ; then
wget -O - "http://downloads.sourceforge.net/project/staden/io_lib/${IOLIBVERSION}/io_lib-${IOLIBVERSION}.tar.gz?&use_mirror=kent" \
> io_lib-${IOLIBVERSION}.tar.gz
fi

# get snappy
if [ ! -f snappy-${SNAPPYVERSION}.tar.gz ] ; then
wget -O - https://snappy.googlecode.com/files/snappy-${SNAPPYVERSION}.tar.gz > snappy-${SNAPPYVERSION}.tar.gz
fi

# get libmaus
if [ ! -f libmaus-${LIBMAUSVERSION}.tar.gz ] ; then
wget -O - https://github.com/gt1/libmaus/archive/${LIBMAUSVERSION}.tar.gz > libmaus-${LIBMAUSVERSION}.tar.gz
fi

# get biobambam
if [ ! -f biobambam-${BIOBAMBAMVERSION}.tar.gz ] ; then
wget -O - https://github.com/gt1/biobambam/archive/${BIOBAMBAMVERSION}.tar.gz > biobambam-${BIOBAMBAMVERSION}.tar.gz
fi

tar xzvf chrpath-${CHRPATHVERSION}.tar.gz
mv chrpath-${CHRPATHVERSION} chrpath-${CHRPATHVERSION}-src
mkdir -p chrpath-${CHRPATHVERSION}-build
cd chrpath-${CHRPATHVERSION}-build
${BUILDDIR}/chrpath-${CHRPATHVERSION}-src/configure --prefix=${TOOLSDIR}
make -j${PAR}
make -j${PAR} install
cd ..
rm -fR chrpath-${CHRPATHVERSION}-src chrpath-${CHRPATHVERSION}-build

rm -fR ${INSTALLDIR}
mkdir -p ${INSTALLDIR}

# build iolib
tar xzvf io_lib-${IOLIBVERSION}.tar.gz
mv io_lib-${IOLIBVERSION} io_lib-${IOLIBVERSION}-src
mkdir -p io_lib-${IOLIBVERSION}-build
cd io_lib-${IOLIBVERSION}-build
LDFLAGS="-Wl,-rpath=XORIGIN/../lib" ${BUILDDIR}/io_lib-${IOLIBVERSION}-src/configure --prefix=${INSTALLDIR}
make -j${PAR}
make -j${PAR} install
cd ..
rm -fR io_lib-${IOLIBVERSION}-src io_lib-${IOLIBVERSION}-build

# build snappy
tar xzvf snappy-${SNAPPYVERSION}.tar.gz
mv snappy-${SNAPPYVERSION} snappy-${SNAPPYVERSION}-src
mkdir -p snappy-${SNAPPYVERSION}-build
cd snappy-${SNAPPYVERSION}-build
LDFLAGS="-Wl,-rpath=XORIGIN/../lib" ${BUILDDIR}/snappy-${SNAPPYVERSION}-src/configure --prefix=${INSTALLDIR}
make -j${PAR}
make -j${PAR} install
cd ..
rm -fR snappy-${SNAPPYVERSION}-src snappy-${SNAPPYVERSION}-build

# build libmaus
tar xzvf libmaus-${LIBMAUSVERSION}.tar.gz
mv libmaus-${LIBMAUSVERSION} libmaus-${LIBMAUSVERSION}-src
mkdir -p libmaus-${LIBMAUSVERSION}-build
cd libmaus-${LIBMAUSVERSION}-build
LDFLAGS="-Wl,-rpath=XORIGIN/../lib" ${BUILDDIR}/libmaus-${LIBMAUSVERSION}-src/configure --prefix=${INSTALLDIR} \
--with-snappy=${INSTALLDIR} \
--with-io_lib=${INSTALLDIR}
make -j${PAR}
make -j${PAR} install
cd ..
rm -fR libmaus-${LIBMAUSVERSION}-src libmaus-${LIBMAUSVERSION}-build

# build biobambam
tar xzvf biobambam-${BIOBAMBAMVERSION}.tar.gz
mv biobambam-${BIOBAMBAMVERSION} biobambam-${BIOBAMBAMVERSION}-src
mkdir -p biobambam-${BIOBAMBAMVERSION}-build
cd biobambam-${BIOBAMBAMVERSION}-build
LDFLAGS="-Wl,-rpath=XORIGIN/../lib" ${BUILDDIR}/biobambam-${BIOBAMBAMVERSION}-src/configure --prefix=${INSTALLDIR} \
--with-libmaus=${INSTALLDIR}
make -j${PAR}
make -j${PAR} install
cd ..
rm -fR biobambam-${BIOBAMBAMVERSION}-src biobambam-${BIOBAMBAMVERSION}-build

for i in `find ${INSTALLDIR} -name \*.so\*` ; do
ORIG=`objdump -x ${i} | grep RPATH | awk '{print $2}'`
MOD=`echo "$ORIG" | sed "s/XORIGIN/\\$ORIGIN/"`
${TOOLSDIR}/bin/chrpath -r "${MOD}" ${i}
done

for i in ${INSTALLDIR}/bin/* ; do
if [ ! -z `LANG=C file ${i} | egrep "ELF.*executable" | awk '{print $1}' | perl -p -e "s/://"` ] ; then
ORIG=`objdump -x ${i} | grep RPATH | awk '{print $2}'`
MOD=`echo "$ORIG" | sed "s/XORIGIN/\\$ORIGIN/"`
${TOOLSDIR}/bin/chrpath -r "${MOD}" ${i}
fi
done

#mv ${INSTALLDIR} biobambam-${BIOBAMBAMVERSION}
#tar czvf biobambam-${BIOBAMBAMVERSION}-`uname -p`-`uname -s`.tar.gz biobambam-${BIOBAMBAMVERSION}
#rm -fR biobambam-${BIOBAMBAMVERSION}

rm -fR ${TOOLSDIR}

# my additions
mv ${INSTALLDIR} biobambam
rm -f chrpath-${CHRPATHVERSION}.tar.gz
rm -f io_lib-${IOLIBVERSION}.tar.gz
rm -f snappy-${SNAPPYVERSION}.tar.gz
rm -f libmaus-${LIBMAUSVERSION}.tar.gz
rm -f biobambam-${BIOBAMBAMVERSION}.tar.gz
Binary file modified docs.tar.gz
Binary file not shown.
5 changes: 3 additions & 2 deletions lib/PCAP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use strict;
use Const::Fast qw(const);
use base 'Exporter';

our $VERSION = '1.1.0';
our $VERSION = '1.1.1';
our @EXPORT = qw($VERSION);

const my $LICENSE =>
Expand All @@ -46,7 +46,8 @@ const my %UPGRADE_PATH => ( '0.1.0' => 'biobambam,samtools,bwa',
'1.0.2' => 'biobambam,bwa',
'1.0.3' => 'biobambam',
'1.0.4' => 'biobambam',
'1.1.0' => '',
'1.1.0' => 'biobambam',
'1.1.1' => '',
);

sub license {
Expand Down
68 changes: 4 additions & 64 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash

SOURCE_BWA="https://github.com/lh3/bwa/archive/0.7.8.tar.gz"
SOURCE_SNAPPY="https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz"
SOURCE_IOLIB="http://sourceforge.net/projects/staden/files/io_lib/1.13.7/io_lib-1.13.7.tar.gz/download"
SOURCE_LIBMAUS="https://github.com/gt1/libmaus/archive/0.0.127-release-20140602112423.tar.gz"
SOURCE_BIOBAMBAM="https://github.com/gt1/biobambam/archive/0.0.147-release-20140602113434.tar.gz"
SOURCE_SAMTOOLS="https://github.com/samtools/samtools/archive/0.1.19.tar.gz"

done_message () {
Expand Down Expand Up @@ -35,14 +31,7 @@ if [ "$#" -ne "1" ] ; then
exit 0
fi

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

INST_PATH=$1
Expand Down Expand Up @@ -124,63 +113,14 @@ fi

if [[ ",$COMPILE," == *,biobambam,* ]] ; then
unset PERL5LIB
echo -n "Building snappy ..."
if [ -e $SETUP_DIR/snappy.success ]; then
echo -n " previously installed ..."
else
(
get_distro "snappy" $SOURCE_SNAPPY
cd $SETUP_DIR/snappy
./configure --prefix=$INST_PATH
make -j$CPU
make -j$CPU install
touch $SETUP_DIR/snappy.success
) >>$INIT_DIR/setup.log 2>&1
fi
done_message "" "Failed to build snappy."

echo -n "Building io_lib ..."
if [ -e $SETUP_DIR/io_lib.success ]; then
echo -n " previously installed ... "
else
(
get_distro "io_lib" $SOURCE_IOLIB
cd $SETUP_DIR/io_lib
./configure --prefix=$INST_PATH
make -j$CPU
make -j$CPU install
touch $SETUP_DIR/io_lib.success
) >>$INIT_DIR/setup.log 2>&1
fi
done_message "" "Failed to build io_lib."

echo -n "Building libmaus ..."
if [ -e $SETUP_DIR/libmaus.success ]; then
echo -n " previously installed ..."
else
(
get_distro "libmaus" $SOURCE_LIBMAUS
cd $SETUP_DIR/libmaus
autoreconf -i -f
./configure --prefix=$INST_PATH --with-snappy=$INST_PATH --with-io_lib=$INST_PATH
make -j$CPU
make -j$CPU install
touch $SETUP_DIR/libmaus.success
) >>$INIT_DIR/setup.log 2>&1
fi
done_message "" "Failed to build libmaus."

echo -n "Building biobambam ..."
if [ -e $SETUP_DIR/biobambam.success ]; then
echo -n " previously installed ..."
else
(
get_distro "biobambam" $SOURCE_BIOBAMBAM
cd $SETUP_DIR/biobambam
autoreconf -i -f
./configure --with-libmaus=$INST_PATH --prefix=$INST_PATH
make -j$CPU
make -j$CPU install
cd $SETUP_DIR
$INIT_DIR/bin/build_biobambam_relocatable.sh
cp -r biobambam/* $INST_PATH/.
touch $SETUP_DIR/biobambam.success
) >>$INIT_DIR/setup.log 2>&1
fi
Expand Down
6 changes: 3 additions & 3 deletions t/3_external_progs.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ my %EXPECTED_VERSION = (
'bamcollate2' => {
'get' => q{ -h},
'match' => qr/This is biobambam version ([[:digit:]\.]+)\./,
'version' => ['0.0.147']},
'version' => ['0.0.148']},
'bammarkduplicates' => {
'get' => q{ -h},
'match' => qr/This is biobambam version ([[:digit:]\.]+)\./,
'version' => ['0.0.147']},
'version' => ['0.0.148']},
'bamsort' => {
'get' => q{ -h},
'match' => qr/This is biobambam version ([[:digit:]\.]+)\./,
'version' => ['0.0.147']},
'version' => ['0.0.148']},
'bwa' => {
'get' => q{},
'match' => qr/Version: ([[:digit:]\.]+[[:alpha:]]?)/, # we don't care about the revision number
Expand Down

0 comments on commit 757d117

Please sign in to comment.