How to run MLST with multiple fastq files
Hi,
I am trying to run a bash script for MLST at CGE (cge.cbs.dtu.dk/services/MLST/). I have fastq files and downloaded the MLST program. When I ran the program with single fastq file (R1 and R2) it is able to generate the results but I am getting problem with the batch run in the script. Please see the script below and the error message.
#!/usr/bin/env bash
if [ -z $1 ] ; then
echo "Hint: $0 Input_Directory_Containing_.fastq.gz Speciesname"
exit 1
fi
inputdir=$1
species=$2
export MLST_DB=/home/CGE_server/mlst/mlst_db
cd ~/HOME_MLST
for files in "$inputdir"/*r1.fastq.gz ; do
echo "Working on $files and ${files/r1.fastq.gz/r2.fastq.gz} for species $species"
#cp $files ${files/r1.fastq.gz/r2.fastq.gz} .
bfile=$(basename $files)
mkdir "${bfile%%r1.fastq.gz}"
sudo docker run --rm -it -v $MLST_DB:/database -v $(pwd):/workdir mlst -i $bfile ${bfile/r1.fastq.gz/r2.fastq.gz} -o ${bfile%%r1.fastq.gz} -s $species -x
echo "Finished working on $files"
done
ERROR:
$bash mlst.sh ecoli
Working on ecoli/*r1.fastq.gz and ecoli/*r2.fastq.gz for species
usage: mlst.py [-h] -i INFILE [INFILE ...] [-o OUTDIR] -s SPECIES
[-p DATABASE] [-t TMP_DIR] [-mp METHOD_PATH] [-x] [-q]
[-matrix]
mlst.py: error: argument -s/--species: expected one argument
Finished working on ecoli/*r1.fastq.gz
• 11 views
Read more here: Source link