-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.sh
More file actions
160 lines (137 loc) · 5.12 KB
/
test.sh
File metadata and controls
160 lines (137 loc) · 5.12 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
# Test Bowtie2
bowtie2_versions=("2.5.3" "2.5.4")
for version in "${bowtie2_versions[@]}"; do
bowtie2_path="/tools/bowtie2/${version}/bowtie2"
if [ -x "$bowtie2_path" ]; then
detected_version=$("$bowtie2_path" --version | head -n1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+$')
if [ "$detected_version" = "$version" ]; then
echo "Bowtie2 version ${version} is installed and correct."
else
echo "Bowtie2 version ${version} is installed but version mismatch (found $detected_version)."
exit 1
fi
else
echo "Bowtie2 version ${version} is not installed or not executable."
exit 1
fi
done
# Test fastp
fastp_versions=("0.23.2")
for version in "${fastp_versions[@]}"; do
if command -v "/tools/fastp/${version}/fastp" >/dev/null 2>&1; then
detected_version=$("/tools/fastp/${version}/fastp" --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+$')
if [ "$detected_version" = "$version" ]; then
echo "Fastp version ${version} is installed and correct."
else
echo "Fastp version ${version} is installed but version mismatch (found $detected_version)."
exit 1
fi
else
echo "Fastp version ${version} is not installed."
exit 1
fi
done
# Test FastQC
fastqc_versions=("0.11.9")
for version in "${fastqc_versions[@]}"; do
fastqc_path="/tools/fastqc/${version}/fastqc"
chmod +x "$fastqc_path"
if [ -x "$fastqc_path" ]; then
detected_version=$("$fastqc_path" --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [ "$detected_version" = "$version" ]; then
echo "FastQC version ${version} is installed and correct."
else
echo "FastQC version ${version} is installed but version mismatch (found $detected_version)."
exit 1
fi
else
echo "FastQC version ${version} is not installed or not executable."
exit 1
fi
done
# Test HMMER
hmmer_versions=("3.2.1" "3.3.2")
for version in "${hmmer_versions[@]}"; do
hmmer_path="/tools/hmmer/${version}/bin/hmmsearch"
if [ -x "$hmmer_path" ]; then
detected_version=$("$hmmer_path" -h | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [ "$detected_version" = "$version" ]; then
echo "HMMER version ${version} is installed and correct."
else
echo "HMMER version ${version} is installed but version mismatch (found $detected_version)."
exit 1
fi
else
echo "HMMER version ${version} is not installed or not executable."
exit 1
fi
done
# Test Pigz
pigz_versions=("2.8")
for version in "${pigz_versions[@]}"; do
pigz_path="/tools/pigz/${version}/pigz"
if [ -x "$pigz_path" ]; then
detected_version=$("$pigz_path" -V | grep -oE '[0-9]+\.[0-9]+$')
if [ "$detected_version" = "$version" ]; then
echo "Pigz version ${version} is installed and correct."
else
echo "Pigz version ${version} is installed but version mismatch (found $detected_version)."
exit 1
fi
else
echo "Pigz version ${version} is not installed or not executable."
exit 1
fi
done
# Test Samtools
samtools_versions=("1.22.1")
for version in "${samtools_versions[@]}"; do
samtools_path="/tools/samtools/${version}/bin/samtools"
if [ -x "$samtools_path" ]; then
detected_version=$("$samtools_path" --version | head -n1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+$')
if [ "$detected_version" = "$version" ]; then
echo "Samtools version ${version} is installed and correct."
else
echo "Samtools version ${version} is installed but version mismatch (found $detected_version)."
exit 1
fi
else
echo "Samtools version ${version} is not installed or not executable."
exit 1
fi
done
# Test Skewer
skewer_versions=("0.2.2")
for version in "${skewer_versions[@]}"; do
skewer_path="/tools/skewer/${version}/skewer"
if [ -x "$skewer_path" ]; then
detected_version=$("$skewer_path" --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+$')
if [ "$detected_version" = "$version" ]; then
echo "Skewer version ${version} is installed and correct."
else
echo "Skewer version ${version} is installed but version mismatch (found $detected_version)."
exit 1
fi
else
echo "Skewer version ${version} is not installed or not executable."
exit 1
fi
done
# Test cd-hit
cd_hit_versions=("4.8.1")
for version in "${cd_hit_versions[@]}"; do
cd_hit_path="/tools/cd-hit/${version}/cd-hit"
if [ -x "$cd_hit_path" ]; then
detected_version=$("$cd_hit_path" | head -n 1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [ "$detected_version" = "$version" ]; then
echo "cd-hit version ${version} is installed and correct."
else
echo "cd-hit version ${version} is installed but version mismatch (found $detected_version)."
exit 1
fi
else
echo "cd-hit version ${version} is not installed or not executable."
exit 1
fi
done