I have this script which works fine when I call it with sh but it fails when I use qsub. Could someone please help me debug this? I can't seem to find an answer online
#!/bin/bash
#$ -S /bin/bash
#$ -V
#$ -cwd
#$ -l h_vmem=6G
#$ -N MHCIp
if [ $# -lt 2 ]
then
echo need 2 arguments
echo "USAGE : qsub run_MHCIprediction.sh <input_peptide_file> <MHCI_allele_file>"
exit 0
fi
input_file=$1
allele_file=$2
output_prefix=`echo ${input_file} | awk -F"." '{print $1}'`
while read -u 10 allele strip_allele
do
/inside/depot4/users/arjun/tools/IEDB/mhc_i/src/predict_binding.py \
IEDB_recommended \
${allele} \
9 \
${input_file} > ${output_prefix}"_"${strip_allele}".tsv"
done 10<${allele_file}
input_file contains values such as
>pept1
ABDGSHADSDJASDAJ
>pept2
AHSYEHDBDJSJAKSK
allele_file looks like
HLA-A*01:01 HLA-A_01_01
HLA-B*03:02 HLA-B_03_02
In case anyone else runs across this, the script in question is from the IEDB MHC class I binding prediction scripts, and the error is introduced when the script tries to read from stdin, which is piped from /dev/null/ in the context of an LSF job, and the end result is adding an empty string to the end of the arguments list.
The relevant section of code looks like this, and the line you'll need to add is "args = filter(None, args)"