-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.sh
executable file
·70 lines (53 loc) · 1.82 KB
/
test.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
#!/usr/bin/env bash
FILE=reads_1.fq
if [ ! -f "$FILE" ]; then
wget https://sourceforge.net/projects/fusioncatcher/files/test/reads_1.fq.gz -O reads_1.fq.gz
wget https://sourceforge.net/projects/fusioncatcher/files/test/reads_2.fq.gz -O reads_2.fq.gz
gzip -f -d *.gz
fi
echo "Testing.."
./fastqtk interleave reads_1.fq reads_2.fq - | ./fastqtk deinterleave - r1.fq r2.fq
if diff "reads_1.fq" "r1.fq" >/dev/null ; then
echo -e " * Test 1 -> Ok!\n"
else
echo -e "\n\n\n\033[33;7m ERROR: Something wrong with FASTQTK! Testing did not go well! \033[0m\n"
exit 1
fi
if diff "reads_2.fq" "r2.fq" >/dev/null ; then
echo -e " * Test 2 -> Ok!\n"
else
echo -e "\n\n\n\033[33;7m ERROR: Something wrong with FASTQTK! Testing did not go well! \033[0m\n"
exit 1
fi
cat reads_1.fq | echo $((`wc -l`/4)) > n_wc.txt
./fastqtk count reads_1.fq n_ftk.txt
if diff "n_wc.txt" "n_ftk.txt" >/dev/null ; then
echo -e " * Test 3 -> ok!\n"
else
echo -e "\n\n\n\033[33;7m ERROR: Something wrong with FASTQTK! Testing did not go well! \033[0m\n"
exit 1
fi
./fastqtk count-lengths reads_1.fq c_ftk.txt l_ftk.txt
cat reads_1.fq | echo $((`wc -l`/4)) > c_wc.txt
cat reads_1.fq | paste - - - - | cut -f 2 | LC_ALL=C awk '{ print length($0) }' | sort -run > l_awk.txt
if diff "c_wc.txt" "c_ftk.txt" >/dev/null ; then
echo -e " * Test 4 -> ok!\n"
else
echo -e "\n\n\n\033[33;7m ERROR: Something wrong with FASTQTK! Testing did not go well! \033[0m\n"
exit 1
fi
if diff "l_awk.txt" "l_ftk.txt" >/dev/null ; then
echo -e " * Test 5 -> ok!\n"
else
echo -e "\n\n\n\033[33;7m ERROR: Something wrong with FASTQTK! Testing did not go well! \033[0m\n"
exit 1
fi
echo -e "\n\033[33;7m Testing of FASTQTK went fine! \033[0m\n"
rm c_wc.txt
rm c_ftk.txt
rm l_ftk.txt
rm l_awk.txt
rm r1.fq
rm r2.fq
rm n_wc.txt
rm n_ftk.txt