forked from cgroza/GraffiTE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraffiTE.def
297 lines (257 loc) · 8.85 KB
/
GraffiTE.def
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
Bootstrap: library
From: ubuntu:20.04
#%files
# repmask_vcf.sh /usr/local/bin
# fix_vcf.py /usr/local/bin
# annotate_vcf.R /usr/local/bin
# one_code_to_find_them_all.pl /usr/local/bin
# build_dictionary.pl /usr/local/bin
# findTSD.sh /usr/local/bin
# TSD_Match.sh /usr/local/bin
%post
apt-get -y update
apt-get install --assume-yes software-properties-common
add-apt-repository universe
apt-get update
apt-get install --assume-yes python3-pip git build-essential zlib1g-dev libcereal-dev libjellyfish-2.0-dev pkg-config cmake r-base-core gawk autoconf
apt-get -y install \
libssl-dev \
libxml2-dev \
libcurl4-openssl-dev \
curl libgomp1 \
perl \
python3-h5py \
libfile-which-perl \
libtext-soundex-perl \
libjson-perl liburi-perl libwww-perl \
libdevel-size-perl \
bedtools \
ncbi-blast+
apt-get install --assume-yes tabix libbz2-dev liblzma-dev libgsl-dev libperl-dev
git clone https://github.com/Dfam-consortium/TETools.git
bash TETools/getsrc.sh
mv src /opt/src
cp TETools/sha256sums.txt /opt/src/
mkdir -p /opt/ucsc_tools
cp TETools/LICENSE.ucsc /opt/ucsc_tools/LICENSE
cd /opt/src
#sha256sum -c sha256sums.txt
# Extract RMBlast
cd /opt \
&& mkdir rmblast \
&& tar --strip-components=1 -x -f src/rmblast-*-x64-linux.tar.gz -C rmblast \
&& rm src/rmblast-*-x64-linux.tar.gz
# Compile HMMER
cd /opt
tar -x -f src/hmmer-*.tar.gz \
&& cd hmmer-* \
&& ./configure --prefix=/opt/hmmer && make && make install \
&& make clean \
&& cd .. && rm src/hmmer-*.tar.gz
# Compile TRF
cd /opt
tar -x -f src/trf-*.tar.gz \
&& cd TRF-* \
&& mkdir build && cd build \
&& ../configure && make && cp ./src/trf /opt/trf \
&& cd .. && rm -r build \
&& cd .. && rm src/trf-*.tar.gz
# Compile RepeatScout
cd /opt
tar -x -f src/RepeatScout-*.tar.gz \
&& cd RepeatScout-* \
&& sed -i 's#^INSTDIR =.*#INSTDIR = /opt/RepeatScout#' Makefile \
&& make && make install \
&& cd .. && rm src/RepeatScout-*.tar.gz
# Compile and configure RECON
cd /opt
tar -x -f src/RECON-*.tar.gz \
&& mv RECON-* RECON \
&& cd RECON \
&& make -C src && make -C src install \
&& cp 00README bin/ \
&& sed -i 's#^\$path =.*#$path = "/opt/RECON/bin";#' scripts/recon.pl \
&& cd .. && rm src/RECON-*.tar.gz
# Compile cd-hit
cd /opt/src
tar -x -f cd-hit-v*.tar.gz \
&& cd cd-hit-v* \
&& make && mkdir /opt/cd-hit && PREFIX=/opt/cd-hit make install \
&& cd .. && rm cd-hit-v*.tar.gz
# Compile genometools (for ltrharvest)
cd /opt/src
tar -x -f gt-*.tar.gz \
&& cd genometools-* \
&& make -j4 cairo=no && make cairo=no prefix=/opt/genometools install \
&& make cleanup && cd .. && rm gt-*.tar.gz
# Configure LTR_retriever
cd /opt \
&& tar -x -f src/LTR_retriever-*.tar.gz \
&& mv LTR_retriever-* LTR_retriever \
&& cd LTR_retriever \
&& sed -i \
-e 's#BLAST+=#BLAST+=/opt/rmblast/bin#' \
-e 's#RepeatMasker=#RepeatMasker=/opt/RepeatMasker#' \
-e 's#HMMER=#HMMER=/opt/hmmer/bin#' \
-e 's#CDHIT=#CDHIT=/opt/cd-hit#' \
paths && cd .. && rm src/LTR_retriever-*.tar.gz
# Compile MAFFT
cd /opt/src
tar -x -f mafft-*-without-extensions-src.tgz \
&& cd mafft-*-without-extensions/core \
&& sed -i 's#^PREFIX =.*#PREFIX = /opt/mafft#' Makefile \
&& make clean && make && make install \
&& make clean && cd ../.. && rm mafft-*-without-extensions-src.tgz
# Compile NINJA
cd /opt \
&& mkdir NINJA \
&& tar --strip-components=1 -x -f src/NINJA-cluster.tar.gz -C NINJA \
&& cd NINJA/NINJA \
&& make clean && make all
# Move UCSC tools
cd /opt/src
mkdir /opt/ucsc_tools \
&& mv faToTwoBit twoBitInfo twoBitToFa /opt/ucsc_tools \
&& chmod +x /opt/ucsc_tools/*
# Compile and configure coseg
cd /opt \
&& mkdir coseg \
&& tar -x -f src/coseg-*.tar.gz -C ./coseg \
&& cd coseg/coseg-coseg-* \
&& mv * ../ \
&& cd ../ \
&& sed -i 's@#!.*perl@#!/usr/bin/perl@' preprocessAlignments.pl runcoseg.pl refineConsSeqs.pl \
&& sed -i 's#use lib "/usr/local/RepeatMasker";#use lib "/opt/RepeatMasker";#' preprocessAlignments.pl \
&& make && cd /opt/ && rm -r src/coseg-*.tar.gz
# Configure RepeatMasker
cd /opt \
&& tar -x -f src/RepeatMasker-*.tar.gz \
&& chmod a+w RepeatMasker/Libraries \
&& chmod a+w RepeatMasker/Libraries/famdb \
&& cd RepeatMasker \
&& gunzip src/dfam38_full.0.h5.gz \
&& mv src/dfam38_full.0.h5 /opt/RepeatMasker/Libraries/famdb/dfam38_full.0.h5 \
&& perl configure \
-hmmer_dir=/opt/hmmer/bin \
-rmblast_dir=/opt/rmblast/bin \
-libdir=/opt/RepeatMasker/Libraries \
-trf_prgm=/opt/trf \
-default_search_engine=rmblast \
&& cd .. && rm src/RepeatMasker-*.tar.gz
# Configure RepeatModeler
cd /opt \
&& tar -x -f src/RepeatModeler-*.tar.gz \
&& mv RepeatModeler-* RepeatModeler \
&& cd RepeatModeler \
&& perl configure \
-cdhit_dir=/opt/cd-hit -genometools_dir=/opt/genometools/bin \
-ltr_retriever_dir=/opt/LTR_retriever -mafft_dir=/opt/mafft/bin \
-ninja_dir=/opt/NINJA/NINJA -recon_dir=/opt/RECON/bin \
-repeatmasker_dir=/opt/RepeatMasker \
-rmblast_dir=/opt/rmblast/bin -rscout_dir=/opt/RepeatScout \
-trf_dir=/opt \
-ucsctools_dir=/opt/ucsc_tools && cd .. && rm src/RepeatModeler-*.tar.gz
# delete unecessary source files
rm -rf /opt/src
git clone https://github.com/marbl/Winnowmap.git
cd Winnowmap
make -j8
cp bin/* /usr/local/bin/
cd ..
rm -r Winnowmap
git clone --recursive https://github.com/samtools/htslib.git
cd htslib
autoreconf -i
./configure
make
make install
cd ${HOME}
git clone https://github.com/samtools/samtools.git
cd samtools
autoheader
autoconf -Wno-syntax
./configure --without-curses
make
make install
cd ${HOME}
rm -rf samtools
git clone https://github.com/samtools/bcftools.git
cd bcftools
autoheader
autoconf
./configure --enable-libgsl --enable-perl-filters
make
make install
cd ${HOME}
rm -rf htslib
rm -rf bcftools
git clone https://github.com/fritzsedlazeck/SURVIVOR.git
cd SURVIVOR/Debug
make
cp SURVIVOR /usr/local/bin
cd $HOME
rm -rf SURVIVOR
git clone https://github.com/lh3/minimap2
cd minimap2
make
cp minimap2 /usr/local/bin
cd $HOME
rm -rf minimap2
mkdir /metadata
echo `dpkg -l | grep jellyfish | tr -s " " | cut -d " " -f 2,3` > /metadata/jellyfish.lib.version
mkdir /repos
cd /repos
git clone https://github.com/eblerjana/pangenie.git
cd pangenie
mkdir build
cd build
# cmake -DCOMPILATION_ARCH=OFF ..
cmake ..
make -j 4
cp src/PanGenie /usr/local/bin
cp src/PanGenie-index /usr/local/bin
cd ..
echo `git rev-parse --short HEAD` > /metadata/pangenie.git.version
cd ${HOME}
pip3 install numpy==1.21
pip3 install pysam pyparsing svim-asm pandas vcfpy sniffles
# pip3 install --upgrade numpy
R --slave -e 'install.packages(c("XML", "dplyr", "stringr", "tidyr", "readr", "vcfR", "optparse"), repos="https://cloud.r-project.org/")'
cd $HOME
# Install dependencies and some basic utilities
apt-get -y update \
&& apt-get -y install \
aptitude \
libgomp1 \
perl \
python3-h5py \
libfile-which-perl \
libtext-soundex-perl \
libjson-perl liburi-perl libwww-perl \
libdevel-size-perl \
&& aptitude install -y ~pstandard ~prequired \
curl wget \
vim nano \
procps strace \
libpam-systemd-
echo "PS1='(dfam-tetools \$(pwd))\\\$ '" >> /etc/bash.bashrc
LANG=C
PYTHONIOENCODING=utf8
PATH=/opt/RepeatMasker:/opt/RepeatMasker/util:/opt/RepeatModeler:/opt/RepeatModeler/util:/opt/coseg:/opt/ucsc_tools:/opt:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
apt-get -y install bc
apt-get remove --assume-yes git software-properties-common cmake make pkg-config build-essential autoconf
apt-get autoremove --assume-yes
apt-get clean --assume-yes
wget -O /usr/local/bin/vg https://github.com/vgteam/vg/releases/download/v1.54.0/vg
chmod +x /usr/local/bin/vg
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
rm -f ~/miniconda.sh
${HOME}/miniconda/bin/conda install -y -c bioconda graphaligner
cp ${HOME}/miniconda/bin/GraphAligner /usr/local/bin/
rm -rf ~/miniconda
%environment
export LC_ALL=C
export LANG=C
export PYTHONIOENCODING=utf8
export PATH=/opt/RepeatMasker:/opt/RepeatMasker/util:/opt/RepeatModeler:/opt/RepeatModeler/util:/opt/coseg:/opt/ucsc_tools:/opt:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin