-
Notifications
You must be signed in to change notification settings - Fork 7
/
INSTALL
107 lines (91 loc) · 2.43 KB
/
INSTALL
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash
#@(#)INSTALL 2024-07-12 A.J.Travis
#
# Install "hyb" under Ubuntu 20.04 LTS
#
# check if package is installed
installed() {
return $(dpkg-query -W -f '${Status}\n' "${1}" 2>&1|awk '/ok installed/{print 0;exit}{print 1}')
}
pkgs=(wget libpng-dev flexbar bowtie2 make gcc unzip ncbi-blast+ fastqc gdebi-core rnahybrid rsync)
for pkg in ${pkgs[@]}; do
if ! $(installed $pkg) ; then
echo sudo apt install -y $pkg
fi
done
# GitHub repository
export GITHUB=https://github.com/gkudla/hyb
# installation directory
if [ $USER == root ]; then
export HYB_HOME=/usr/local/hyb
else
export HYB_HOME=${HOME}/hyb
fi
# set PATH for "hyb" test run
export PATH=${HYB_HOME}/bin:$PATH
echo "Please add ${HYB_HOME}/bin to your PATH after running the INSTALL script"
echo "(press any key to continue...)"
read -n 1 key; echo
# download directory must be writeable
dir=$(pwd)
if [ ! -w ${dir} ]; then
echo "$0: can't write to ${dir}"
exit 1
fi
# check if "hyb" is already installed
if [ -e ${HYB_HOME} ]; then
echo "$0: ${HYB_HOME} already exists - replace it?"
read -n 1 key; echo
if [ "$key" == "y" ]; then
rm -r ${HYB_HOME}
else
echo "$0: installation cancelled"
exit 1
fi
fi
# install hyb files
mkdir -p ${HYB_HOME}
rsync -axHP bin lib man data ${HYB_HOME}
# download and compile BLAT (requires libpng-dev)
wget -nc http://users.soe.ucsc.edu/~kent/src/blatSrc35.zip
unzip blatSrc35.zip
export MACHTYPE=$(arch)
mkdir -p ${HOME}/bin/${MACHTYPE}
cd blatSrc
make
# move to BLAT installation directory
if [ $USER == root ]; then
mv -i ${HOME}/bin/${MACHTYPE}/* /usr/local/bin/
else
export PATH=${HOME}/bin/${MACHTYPE}:${PATH}
fi
# build databases
cd ${HYB_HOME}/data/db
make
# UNAfold
if [ ! -x "$(which hybrid-min)" ]; then
if [ $USER == root ]; then
wget http://www.unafold.org/download/oligoarrayaux-3.8.tar.bz2
tar xf oligoarrayaux-3.8.tar.bz2
cd oligoarrayaux-3.8
make install
else
echo "$0: install bio-linux-oligoarrayaux to test hyb"
exit 1
fi
fi
# Vienna RNA
if [ ! -x "$(which RNAfold)" ]; then
if [ $USER == root ]; then
wget https://www.tbi.univie.ac.at/RNA/download/ubuntu/ubuntu_20_04/viennarna_2.5.1-1_amd64.deb
gdebi viennarna_2.5.1-1_amd64.deb
else
echo "$0: install Vienna RNA to test hyb"
exit 1
fi
fi
# test
cd ${HYB_HOME}/data/fastq
hyb analyse in=testdata.txt db=hOH7
# finished
exit 0