-
Notifications
You must be signed in to change notification settings - Fork 3
/
benchmarking.bash
executable file
·64 lines (54 loc) · 3.25 KB
/
benchmarking.bash
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
#!/usr/bin/bash
#### Provide a path to a file.
#### To download a file use:
# wget URL
input_path=$1
output_path=$2
gbam_binary_path=$3
sambamba_binary_path=$4
# Perform operations using input and output paths
echo "Input path: $input_path"
echo "Output path (should be without format suffix): $output_path"
echo "GBAM binary path: $gbam_binary_path"
echo "Sambamba binary path: $sambamba_binary_path"
echo "Temp dir is set as: $TMPDIR"
samtools_sorted_bam_file="$output_path.sorted.samtools.bam"
sambamba_sorted_bam_file="$output_path.sorted.sambamba.bam"
gbam_file="$output_path.gbam"
gbam_index_file="$output_path.gbam.gbai"
samtools_depth_file="$output_path.samtools.depth"
sambamba_depth_file="$output_path.sambamba.depth"
gbam_depth_file="$output_path.gbam.depth"
echo "---------------------------------------------------------------------------------------------------------------"
echo ""
echo "Benchmark gbam index-sort versus samtools and sambamba sort (you have to be built on feature/index_sort branch)..."
echo ""
echo ""
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v $gbam_binary_path $input_path -c -s --sort-temp-mode ram -o $gbam_file --index-sort
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v samtools sort -@ 8 $input_path -o $samtools_sorted_bam_file
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v $sambamba_binary_path sort -t 8 $input_path -o $sambamba_sorted_bam_file -m 90GB
echo "---------------------------------------------------------------------------------------------------------------"
echo ""
echo "Benchmark gbam flagstat versus samtools and sambamba flagstat..."
echo ""
echo ""
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v $gbam_binary_path --flagstat $gbam_file
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v samtools flagstat -@ 8 $samtools_sorted_bam_file
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v $sambamba_binary_path flagstat -t 8 $sambamba_sorted_bam_file
echo "---------------------------------------------------------------------------------------------------------------"
echo ""
echo "Benchmark gbam depth versus samtools and sambamba depth..."
echo ""
echo ""
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v $gbam_binary_path --depth $gbam_file --thread-num 12 --index-file $gbam_index_file > $gbam_depth_file
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v samtools depth -@ 8 $samtools_sorted_bam_file > $samtools_depth_file
echo "---------------------------------------------------------------------------------------------------------------"
/usr/bin/time -v $sambamba_binary_path depth base -t 8 $sambamba_sorted_bam_file > $sambamba_depth_file