-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgetCompleteness.sh
executable file
·55 lines (46 loc) · 1.17 KB
/
getCompleteness.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
#!/bin/bash
# state usage
function usage() {
echo "Usage: doCompleteness.sh -f <fasta> [ -m <bac|arch> ]"
echo "Default mode: bac"
echo "Output: .faa, .gff, .hmm, and .report"
exit
}
# if number or arguments is less than 2, invoke usage function
if [ $# -lt 2 ]; then
usage
fi
# state options
while getopts ":f:m:" opt; do
case $opt in
f) fasta=${OPTARG};;
m) mode=${OPTARG};;
*) usage ;;
esac
done
# set base
name=${fasta%.fasta}
# # do prodigal
# echo "## Predicting ORFs.. ##"
# prodigal-2.60 -q -i $fasta -o $name.gff -a $name.faa
# do mode
# set default
weights=/local/one/tools/micomplete/Bact139.weights
inputhmm=/local/one/tools/micomplete/Bact139.hmm
# if -m is specified
if [ "$mode" = "bac" ]; then
weights=/local/one/tools/micomplete/Bact139.weights
inputhmm=/local/one/tools/micomplete/Bact139.hmm
elif [ "$mode" = "arch" ]; then
weights=/local/one/tools/micomplete/Arch162.weights
inputhmm=/local/one/tools/micomplete/Arch162.hmm
fi
# do micomplete
echo "## Checking completeness ##"
micomplete.pl \
-w $weights \
-h $inputhmm \
-r $name.completeness.hmm \
--histogram \
$fasta \
&> $name.completeness.report