-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-referenceseeker
executable file
·81 lines (64 loc) · 1.4 KB
/
run-referenceseeker
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
#! /bin/bash
if [ -z "$REFSEEK" ] ; then
if [ -d $HOME/scratch/referenceseeker ] ; then
REFSEEK=$HOME/scratch/referenceseeker
else
echo 1>&2 REFSEEK not set
exit 1
fi
elif [ ! -d "$REFSEEK" ] ; then
echo 1>&2 $REFSEEK does not exist
exit 1
fi
function usage {
echo 1>&2 "Usage: $0 [options] genome.fna"
echo 1>&2 "-a ANI - ANI cutoff [0.95]"
echo 1>&2 "-g - only run against GTDB"
echo 1>&2 "-h - this message"
echo 1>&2 "-r - only run against RefSeq"
echo 1>&2 "-u - unfiltered results"
exit "$@"
}
while getopts 'a:ghru' opt ; do
case "$opt" in
a) opt_a="--ani $OPTARG" ;;
h) opt_h=1 ;;
g) opt_g=1 ;;
r) opt_r=1 ;;
u) opt_u="--unfiltered" ;;
\?) usage 1 ;;
*) echo 1>&2 "Can't happen" ; exit 1 ;;
esac
done
shift $((OPTIND-1))
if [ "$opt_h" ] ; then
usage
fi
if [ -z "$1" -o "$2" ] ; then
usage 1
fi
if [ -z "$opt_g" -a -z "$opt_r" ] ; then
# opt_g=1 # GTDB is no more.
opt_r=1
fi
rm -rf $REFSEEK/temp
mkdir -p $REFSEEK/temp/tmp
cp "$1" $REFSEEK/temp/genome.fasta
echo "${PS4}cd $REFSEEK"
cd $REFSEEK
export HOWTO_MOUNT_DIR=
export HOWTO_TMPDIR=
if [ "$opt_r" ] ; then
echo 1>&2 '### Refseq'
(
set -x
referenceseeker $opt_a $opt_u ./bacteria-refseq ./temp/genome.fasta
)
fi
if [ "$opt_g" ] ; then
echo 1>&2 '### GTDB'
(
set -x
referenceseeker $opt_a $opt_u ./bacteria-gtdb ./temp/genome.fasta
)
fi