-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
executable file
·79 lines (70 loc) · 2.42 KB
/
install.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
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
########################################################################
###
### Copyright (c) 2020, Wasserman lab
###
### FILE install.sh
###
### DESCRIPTION This is the install.sh script for the project.
### We use conda in order to install the application.
###
### Initial version @ Godfrain Jacques KOUNKOU
### Modified @ Phillip Richmond
########################################################################
# set -e
##########################################
# DESC This function will find all FlexTyper dependencies and build FlexTyper
# ARGS This function doesnt require any arguments
# RSLT The side effect is the newly created FlexTyper directory with the FlexTyper binary
##########################################
function buildFlexTyper()
{
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OPT_DIR=${DIR}/opt
mkdir -p ${OPT_DIR}
pushd ${OPT_DIR}
MINI_CONDA_INSTALL_DIR=$OPT_DIR/miniconda3
if [ ! -f Miniconda3-latest-Linux-x86_64.sh ]; then
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
fi
bash Miniconda3-latest-Linux-x86_64.sh -b -p $MINI_CONDA_INSTALL_DIR
source ${MINI_CONDA_INSTALL_DIR}/etc/profile.d/conda.sh
if [ ! -d ${OPT_DIR}/openFlexTyper ]; then
conda env create --prefix ${OPT_DIR}/openFlexTyper -f $DIR/OpenFlexTyper_CondaEnv.yml
fi
cd $DIR
conda activate opt/openFlexTyper
mkdir -p build
cd build/
qmake ..
make
}
##########################################
# DESC This function will clone seqtk repository and build it
# ARGS This function doesnt take any arguments
# RSLT The side effect is the newly create seqtk directory with the seqtk binary
##########################################
function buildSeqTk() {
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
git clone https://github.com/lh3/seqtk.git
cd seqtk
make
cd $DIR
}
##########################################
# DESC This function creates an utils directory inside the build directory
# It contains flextyper and seqtk
# ARGS This function takes no arguments
# RSLT The side effect is the new utils directory
##########################################
function createBinDirectory() {
local bindir='bin'
if [ ! -d ${bindir} ]; then
mkdir ${bindir}
cp seqtk/seqtk ${bindir}/seqtk
cp flextyper ${bindir}/flextyper
fi
}
buildFlexTyper
buildSeqTk
createBinDirectory