Skip to content

Commit 79e1b84

Browse files
committed
Reduce container size by deleting files
1 parent f08bcbd commit 79e1b84

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

Singularity.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ PATH=/bioinf-tools/:/bioinf-tools/cortex/bin/:/bioinf-tools/cortex/scripts/analy
2424
cd /clockwork/python
2525
python3 setup.py test
2626
python3 setup.py install
27+
cd /
28+
rm -rf /clockwork
2729
service mysql stop
2830
apt remove -y mysql-server
31+
apt autoremove -y
2932

3033

3134
%labels

scripts/install_dependencies.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ cd $install_root
5959
cd $install_root
6060
wget -q https://github.com/samtools/bcftools/releases/download/1.15.1/bcftools-1.15.1.tar.bz2
6161
tar xf bcftools-1.15.1.tar.bz2
62+
rm bcftools-1.15.1.tar.bz2
6263
cd bcftools-1.15.1/
6364
make
65+
make install
6466
cd ..
65-
cp -s bcftools-1.15.1/bcftools .
67+
rm -rf bcftools-1.15.1
6668

6769
#_____________________ enaBrowserTools ____________________#
6870
cd $install_root
@@ -75,6 +77,7 @@ git checkout 7075a896f822e3ea3d3fac8bc10bcfeeb2506685
7577
cd $install_root
7678
wget -q https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.5.zip
7779
unzip fastqc_v0.11.5.zip
80+
rm fastqc_v0.11.5.zip
7881
chmod 755 FastQC/fastqc
7982
cp -s FastQC/fastqc .
8083

@@ -95,7 +98,8 @@ cd mccortex
9598
git checkout 5a9d410468f6b2980434e415ec341be320d37d82
9699
make all
97100
cd ..
98-
cp -s mccortex/bin/mccortex31 .
101+
mv mccortex/bin/mccortex31 .
102+
rm -rf mccortex
99103

100104
#------------------------------ minimap2 ---------------------------------------
101105
cd $install_root
@@ -129,8 +133,10 @@ pip3 install .
129133
myk_dir=$(pip3 show mykrobe | awk '/^Location/ {print $NF}')
130134
echo $myk_dir
131135
cp mccortex/bin/mccortex31 $myk_dir/mykrobe/cortex/mccortex31
136+
rm -rf mccortex
132137
mykrobe panels update_metadata --debug
133138
mykrobe panels update_species --debug all
139+
rm -rf .git
134140

135141

136142
#________________________ nextflow _______________________#
@@ -156,26 +162,30 @@ cp -s seqtk-1.2/seqtk .
156162
cd $install_root
157163
wget -q https://github.com/samtools/samtools/releases/download/1.15.1/samtools-1.15.1.tar.bz2
158164
tar xf samtools-1.15.1.tar.bz2
165+
rm samtools-1.15.1.tar.bz2
159166
cd samtools-1.15.1/
160167
make
168+
make install
161169
cd ..
162-
cp -s samtools-1.15.1/samtools .
163-
cp -rp samtools-1.15.1/misc/plot-bamstats .
170+
rm -rf samtools-1.15.1
164171

165172

166173
#________________________ Trimmomatic ____________________#
167174
cd $install_root
168175
wget -q http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/Trimmomatic-0.36.zip
169176
unzip Trimmomatic-0.36.zip
177+
rm Trimmomatic-0.36.zip
170178

171179
#________________________ vcftools _______________________#
172180
cd $install_root
173181
wget -q https://github.com/vcftools/vcftools/releases/download/v0.1.15/vcftools-0.1.15.tar.gz
174182
tar xf vcftools-0.1.15.tar.gz
183+
rm vcftools-0.1.15.tar.gz
175184
cd vcftools-0.1.15
176185
./configure --prefix $PWD/install
177186
make
178187
make install
188+
rm -rf src/cpp
179189

180190
# cortex needs the perl/ directory. It expects it to be in the vcftools root,
181191
# but somehwere between v0.1.9 and v0.1.15 it moved into src/.
@@ -189,6 +199,7 @@ git checkout c8147152cd4015c45057900e8fb600376d1d7fb3
189199
bash install.sh
190200
make NUM_COLS=1 cortex_var
191201
make NUM_COLS=2 cortex_var
202+
rm -rf .git
192203

193204
# ___________________ python packages ___________________#
194205
# note: requests needs to be here instead of as part of
@@ -218,15 +229,19 @@ cmake .. -DCMAKE_BUILD_TYPE=REL_WITH_ASSERTS
218229
make gram
219230
cd ..
220231
pip3 install -e .
232+
rm -rf cmake-build .git
221233

222234
#________________________ mummer ____________________________#
223235
cd $install_root
224236
wget -q https://github.com/mummer4/mummer/releases/download/v4.0.0beta2/mummer-4.0.0beta2.tar.gz
225237
tar xf mummer-4.0.0beta2.tar.gz
238+
rm mummer-4.0.0beta2.tar.gz
226239
cd mummer-4.0.0beta2
227240
./configure
228241
make
229242
make install
243+
cd ..
244+
rm -rf mummer-4.0.0beta2
230245

231246

232247
#________________________ vt __________________________________#
@@ -235,6 +250,7 @@ git clone https://github.com/atks/vt.git vt-git
235250
cd vt-git
236251
git checkout 2187ff6347086e38f71bd9f8ca622cd7dcfbb40c
237252
make
253+
rm -rf .git
238254
cd ..
239255
cp -s vt-git/vt .
240256

0 commit comments

Comments
 (0)