forked from fbartusch/snakemake_tutorial
-
Notifications
You must be signed in to change notification settings - Fork 2
/
measure_comparison.sh
executable file
·85 lines (73 loc) · 2.58 KB
/
measure_comparison.sh
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
#!/bin/bash
# This script assumes that we start in the same directory as this script,
# and will run and save results for different pipelines (to compare later)
# sudo apt-get install -y valgrind
# usage source measure_comparison.sh
HERE=$PWD
DATA=$HERE/data
RESULT=$HERE/results
DOBUILD=0
mkdir -p $RESULT
function clean () {
echo
echo "Cleaning up previous results..."
rm -rf $HERE/data/sorted_reads
rm -rf $HERE/data/mapped_reads
rm -rf $HERE/data/calls
rm -rf $HERE/data/genome.fa.*
rm -rf $HERE/data/report.html
}
function doBuild() {
if [ ${DOBUILD} -eq "1" ]
then
$1
fi
}
# Docker
clean
doBuild "docker build --no-cache -t vanessa/snakemake.scif ."
docker run -v $PWD/data:/scif/data -it vanessa/snakemake.scif run valgrind
mv data/massif.* $RESULT/docker
clean
docker run -v $PWD/data:/scif/data -it vanessa/snakemake.scif run timeit
mv data/snakemake-times.log $RESULT/docker
sudo chown -R vanessa data/
# Singularity
clean
doBuild "sudo singularity build snakemake.simg Singularity"
singularity run --bind data/:/scif/data snakemake.simg run valgrind
mv data/massif.* $RESULT/singularity
clean
singularity run --bind data/:/scif/data snakemake.simg run timeit
mv data/snakemake-times.log $RESULT/singularity
# Charliecloud
clean
doBuild "ch-build -t snakemake.ch ."
doBuild "ch-docker2tar snakemake.ch /var/tmp"
doBuild "ch-tar2dir /var/tmp/snakemake.ch.tar.gz /var/tmp"
ch-run --cd $PWD -b data:/scif/data /var/tmp/snakemake.ch -- /opt/conda/bin/scif run valgrind
mv data/massif.* $RESULT/charliecloud
clean
ch-run --cd $PWD -b data:/scif/data /var/tmp/snakemake.ch -- /opt/conda/bin/scif run timeit
mv data/snakemake-times.log $RESULT/charliecloud
# Runc
clean
mkdir -p /tmp/runc/rootfs
mkdir -p /tmp/runc/tmp
doBuild "sudo singularity build --sandbox /tmp/runc/rootfs snakemake.simg"
cp configs/runc-config-valgrind.json /tmp/runc/config.json
runc --root /tmp/runc run --bundle /tmp/runc snakmake.runc
mv data/massif.* $RESULT/runc
clean
cp configs/runc-config-timeit.json /tmp/runc/config.json
runc --root /tmp/runc run --bundle /tmp/runc snakmake.runc
mv data/snakemake-times.log $RESULT/runc
# Shifter
clean
#echo "Shifter pipeline will be run on cluster!"
#echo "shifter --image=vanessa/snakemake.scif --volume `pwd`/data:/scif/data --workdir /scif/data /opt/conda/bin/scif run snakemake all"
# Just show files / results are the same!
diff results/docker/calls.vcf results/singularity/calls.vcf
diff results/docker/calls.vcf results/runc/calls.vcf
diff results/docker/calls.vcf results/shifter/calls.vcf
diff results/docker/calls.vcf results/charliecloud/calls.vcf