-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_mlst
executable file
·56 lines (46 loc) · 1.67 KB
/
run_mlst
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
#!/bin/bash
# Help function
show_help() {
echo "Usage: $0 <runid> <sampleid> [--blastdb path] [--datadir path]"
echo
echo "Required arguments:"
echo " runid Run ID (format: XYYYY...)"
echo " sampleid Sample ID"
echo
echo "Optional arguments:"
echo " --blastdb Path to BLAST database (default: /home/mdu/resources/mlst/blast/mlst.fa)"
echo " --datadir Path to MLST data directory (default: /home/mdu/resources/mlst/pubmlst)"
echo
echo "Before running the script:"
echo " conda activate /home/khhor/conda/envs/mlst/"
}
# Default values
BLASTDB="/home/mdu/resources/mlst/blast/mlst.fa"
DATADIR="/home/mdu/resources/mlst/pubmlst"
# Parse arguments
if [ "$#" -lt 2 ]; then
show_help
exit 1
fi
runid=$1
sampleid=$2
shift 2
# Parse optional arguments
while [ "$#" -gt 0 ]; do
case "$1" in
--blastdb) BLASTDB="$2"; shift 2;;
--datadir) DATADIR="$2"; shift 2;;
--help|-h) show_help; exit 0;;
*) echo "Unknown parameter: $1"; show_help; exit 1;;
esac
done
# Extract YYYY from runid
YYYY=${runid:1:4}
# Change directory
# cd "/home/mdu/qc/$YYYY/$runid" || { echo "Directory not found"; exit 1; }
echo "Output for spades:"
mlst --quiet --blastdb "$BLASTDB" --datadir "$DATADIR" --nopath /home/mdu/data/"$runid"/"$sampleid"/spades/spades.fa --exclude ecoli
echo "Output for shovill:"
mlst --quiet --blastdb "$BLASTDB" --datadir "$DATADIR" --nopath /home/mdu/data/"$runid"/"$sampleid"/shovill/current/contigs.fa --exclude ecoli
echo "Output for skesa:"
mlst --quiet --blastdb "$BLASTDB" --datadir "$DATADIR" --nopath /home/mdu/data/"$runid"/"$sampleid"/skesa/current/skesa.fa --exclude ecoli