File: install_dependencies.sh

package info (click to toggle)
ariba 2.14.6%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 22,484 kB
  • sloc: python: 14,240; cpp: 733; xml: 101; sh: 57; makefile: 13; perl: 9
file content (73 lines) | stat: -rwxr-xr-x 1,774 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -e
set -x

start_dir=$(pwd)

BOWTIE2_VERSION=2.3.1
CDHIT_VERSION=4.6.5
MUMMER_VERSION=3.23

BOWTIE2_DOWNLOAD_URL="http://downloads.sourceforge.net/project/bowtie-bio/bowtie2/${BOWTIE2_VERSION}/bowtie2-${BOWTIE2_VERSION}-legacy-linux-x86_64.zip"
CDHIT_DOWNLOAD_URL="https://github.com/weizhongli/cdhit/archive/V${CDHIT_VERSION}.tar.gz"
MUMMER_DOWNLOAD_URL="http://downloads.sourceforge.net/project/mummer/mummer/${MUMMER_VERSION}/MUMmer${MUMMER_VERSION}.tar.gz"


# Make an install location
if [ ! -d 'build' ]; then
  mkdir build
fi
cd build
build_dir=$(pwd)

# DOWNLOAD ALL THE THINGS
download () {
  url=$1
  download_location=$2

  if [ -e $download_location ]; then
    echo "Skipping download of $url, $download_location already exists"
  else
    echo "Downloading $url to $download_location"
    wget $url -O $download_location
  fi
}


# --------------- bowtie2 ------------------
cd $build_dir
download $BOWTIE2_DOWNLOAD_URL "bowtie2-${BOWTIE2_VERSION}-legacy.zip"
bowtie2_dir="$build_dir/bowtie2-${BOWTIE2_VERSION}-legacy"
unzip -n bowtie2-${BOWTIE2_VERSION}-legacy.zip


# --------------- cdhit --------------------
cd $build_dir
download $CDHIT_DOWNLOAD_URL "cdhit-${CDHIT_VERSION}.tar.gz"
tar -zxf cdhit-${CDHIT_VERSION}.tar.gz
cdhit_dir="$build_dir/cdhit-${CDHIT_VERSION}"
cd $cdhit_dir
make


# --------------- mummer ------------------
cd $build_dir
download $MUMMER_DOWNLOAD_URL "MUMmer${MUMMER_VERSION}.tar.gz"
mummer_dir="$build_dir/MUMmer${MUMMER_VERSION}"
tar -zxf MUMmer${MUMMER_VERSION}.tar.gz
cd $mummer_dir
make


cd $start_dir

update_path () {
  new_dir=$1
  if [[ ! "$PATH" =~ (^|:)"${new_dir}"(:|$) ]]; then
    export PATH=${new_dir}:${PATH}
  fi
}

update_path ${bowtie2_dir}
update_path ${cdhit_dir}
update_path ${mummer_dir}