-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathinstall_dependencies.sh
executable file
·68 lines (56 loc) · 1.42 KB
/
install_dependencies.sh
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
#!/bin/bash
# this tries to install all the necessary dependencies...
# first argument is directory where stuff is to be installed
DEFAULT_INSTALL_DIR=~/split_seq_reqs
install_dir=$DEFAULT_INSTALL_DIR
if [ -z "$1" ]
then
echo "Default install dir: $install_dir"
else
install_dir=$1
fi
echo "Installing dependencies to $install_dir"
# TODO: allow for user install dir as a custom arg
mkdir -p $install_dir
cd $install_dir
mkdir bin
# append to path?
#if echo $PATH | grep -q $1; then
# echo "PATH contains dir"
#else
# export PATH=$1/bin:$PATH
# echo "\nexport PATH=$1/bin:$PATH" >> ~/.bashrc
# . ~/.bashrc
#fi
# install STAR
echo "Installing STAR..."
# TODO: test if STAR already exists
if [ -x "$(command -v STAR)" ]; then
echo "STAR is installed"
else
wget https://github.com/alexdobin/STAR/archive/2.6.1c.tar.gz
tar -xzf 2.6.1c.tar.gz
cd STAR-2.6.1c
cd source
make STAR
cp STAR ../../bin
cd $install_dir
rm 2.6.1c.tar.gz
echo "STAR is installed"
fi
cd $install_dir
# install samtools
if [ -x "$(command -v samtools)" ]; then
echo "samtools is installed"
else
wget https://github.com/samtools/samtools/releases/download/1.9/samtools-1.9.tar.bz2
tar -xf samtools-1.9.tar.bz2
cd samtools-1.9
./configure --prefix=$install_dir/
make
make install
cp samtools ../bin
cd $install_dir
rm samtools-1.9.tar.bz2
echo "samtools is installed"
fi