forked from UCL-ARC/rcps-buildscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHammock_v_1.0.5_install
executable file
·59 lines (43 loc) · 1.89 KB
/
Hammock_v_1.0.5_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
#!/usr/bin/env bash
###############################################
# User install script for Hammock, also runnable by do-hammock-install alias in hammock module.
#
# by Heather Kelly, 2016
#
NAME=${NAME:-Hammock}
VERSION=${VERSION:-1.0.5}
INSTALL_PREFIX=${INSTALL_PREFIX:-$HOME}
SRC_ARCHIVE=${SRC_ARCHIVE:-https://github.com/hammock-dev/hammock/releases/download/v${VERSION}/${NAME}_v_${VERSION}.7z}
MD5=${MD5:-fd8ad5f2c7f0e5da4fc287883a3c6ad7}
set -e
# module prereqs for installing
dirname=$(dirname $0 2>/dev/null)
INCLUDES_DIR=${INCLUDES_DIR:-${dirname}/includes}
source ${INCLUDES_DIR}/require_inc.sh
require gcc-libs/4.9.2
require p7zip/15.09/gnu-4.9.2
cd $INSTALL_PREFIX
wget $SRC_ARCHIVE
archive=$(basename "${SRC_ARCHIVE}")
CHECKSUM=`md5sum $archive| awk '{print $1}'`
if [ "$MD5" == "$CHECKSUM" ]
then
7z x $archive
echo "------------------------------"
echo "Backing up settings.prop to settings.prop.orig, modifying to use clustal-omega and hmmer from modules."
# Back up original settings
settings=${INSTALL_PREFIX}/${NAME}_v_${VERSION}/settings/settings.prop
cp $settings ${INSTALL_PREFIX}/${NAME}_v_${VERSION}/settings/settings.prop.orig
# Modify settings.prop to use our modules for clustal-omega and hmmer: pick the executables that are in your PATH.
sed -i -e "s|#clustalOmegaCommand=|clustalOmegaCommand=clustalo|" $settings
sed -i -e "s|#hmmbuildCommand=|hmmbuildCommand=hmmbuild|" $settings
sed -i -e "s|#hmmsearchCommand=|hmmsearchCommand=hmmsearch|" $settings
# Set temporary directory to your Scratch - can't use environment variables like $TMPDIR inside settings.prop.
sed -i -e "s|#tempDirectory=|tempDirectory=${HOME}/Scratch|" $settings
echo "Using Scratch for temporary files, written as directories called Hammock_temp_time."
echo "You will want to clear these up at intervals."
else
echo "Hash mismatch."
echo "Expected: $MD5"
echo "Got: $CHECKSUM"
fi