-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathginkgo-install
More file actions
executable file
·86 lines (65 loc) · 2.32 KB
/
ginkgo-install
File metadata and controls
executable file
·86 lines (65 loc) · 2.32 KB
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
#!/usr/bin/bash -i
###############################################
# Installing ginkgo
#
# by Javier Herrero, 2019
#
APPNAME=${APPNAME:-ginkgo}
VERSION=${VERSION:-v082019}
COMMIT=${COMMIT:-364ef93d3bdabe8ad58f70bbc80f962c652e943e}
INSTALL_PREFIX=${INSTALL_PREFIX:-/shared/ucl/depts/cancer/apps/$APPNAME/}
MD5=${MD5:-0269a81335f16427fbfe7545ea856aeb}
SHA1=${SHA1:-REPLACE}
SRC_ARCHIVE=${SRC_ARCHIVE:-https://github.com/UCL-BLIC/ginkgo/archive/${COMMIT}.zip}
set -e
module purge
module load r/recommended
module load compilers/intel/2019
export PATH=$INSTALL_PREFIX/bin:$PATH
mkdir -p $INSTALL_PREFIX
rm -rf ${INSTALL_PREFIX}/${VERSION}
cd ${INSTALL_PREFIX}
wget -N $SRC_ARCHIVE
MD5SUM=`md5sum ${COMMIT}.zip | awk '{print $1}'`
if [ "$MD5SUM" != "$MD5" ]
then
echo "Hash mismatch."
echo "Expected: $MD5"
echo "Got: $MD5SUM"
exit
fi
# Uncompress the software
unzip -q ${COMMIT}.zip
rm ${COMMIT}.zip
mv ${APPNAME}-${COMMIT} ${VERSION}
cd ${VERSION}
make
# Include the genome files
mkdir -p ~/Scratch/${APPNAME}/genomes/hg19/original
ln -s /scratch/scratch/${USER}/${APPNAME}/genomes/hg19/ genomes/
cd ~/Scratch/${APPNAME}/genomes/hg19/original
wget -N http://qb.cshl.edu/ginkgo/uploads/hg19.original.tar.gz
tar -zxf hg19.original.tar.gz
rm hg19.original.tar.gz
# Install devtools and BiocManager (in HOME as can be used for many other projects) if required
mkdir -p ~/R
env R_LIBS=${HOME}/R R --vanilla <<'EOF'
if (!("devtools" %in% rownames(installed.packages()))) {
install.packages("devtools", lib = "~/R", repos = "https://cran.ma.imperial.ac.uk/")
}
if (!("BiocManager" %in% rownames(installed.packages()))) {
install.packages("BiocManager", lib = "~/R", repos = "https://cran.ma.imperial.ac.uk/")
}
EOF
# Add the R libraries for ginkgo
cd ${INSTALL_PREFIX}/${VERSION}
mkdir -p R
env R_LIBS=${INSTALL_PREFIX}/${VERSION}/R:${HOME}/R R --vanilla <<'EOF'
# amap is required by ctc and the default version is not compatible with the R version we are using here
install.packages("https://cran.r-project.org/src/contrib/Archive/amap/amap_0.8-14.tar.gz", lib = "R")
# Install ctc from bioconductor
BiocManager::install("ctc", lib = "R")
# Need to use a different version of gplots as the default one is very slow because of a bug (always calculates a HC of all rows)
library("devtools")
install_github("ChristophH/gplots", lib = "R")
EOF