-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbenchmark_stream.sh
37 lines (32 loc) · 1.03 KB
/
benchmark_stream.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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
set -euo pipefail
# Uses: 'hyperfine', available with 'conda install -y -c conda-forge hyperfine'
command -v hyperfine || exit 1
if [ ! -e "$DIR"/../TE/example1.bam ]; then
echo "Download the input datasets first"
exit
fi
for FILE in "$DIR"/../TE/example1.bam "$DIR"/../TE/example2.bam "$DIR"/../TE/HG00258.bam;
do
TAG=$(basename $FILE | cut -f1 -d.)
if [ ! -e "$FILE" ]; then
echo "$FILE not found. Try re-downloading the datasets"
exit 2
fi
if [ ! -z ${1+x} ];
then
# skip exome
if [ "$TAG" == "HG00258" ]; then
echo "Skipping exome: specify any parameter to include it";
exit;
fi
fi
echo "$TAG [$FILE]"
hyperfine --warmup 1 --min-runs 6 --cleanup 'rm *.bed || true' \
--export-csv stream/benchmark_$TAG.csv --export-markdown stream/benchmark_$TAG.md \
"samtools depth $FILE > /dev/null" \
"samtools depth -a $FILE > /dev/null" \
"covtobed $FILE > /dev/null" \
"bedtools genomecov -bga -ibam $FILE > /dev/null"
done