尝试为SGE创建提交脚本

时间:2017-10-26 14:15:20

标签: bash submit qsub

我尝试将我的工作bash脚本编辑为SGE脚本,以便将其作为作业提交给群集。

目前我有:

#!/bin/bash

# Perform fastqc on files in a specified directory.

for ((j=1; j <=17; j++))
do
   directory=/data4/una/batch"$j"/
   files=$""$directory"/*.fastq.gz"
   batch=$"batch_"$j""
   outfile=$""$batch"_submit_script.sh"

     echo "#!/bin/bash">>$outfile;
     echo "# Your job name">>$outfile;
     echo "# -N $batch">>$outfile;
     echo "# The job should be placed into the queue 'all.q'">>$outfile;
     echo "#$ -q all.q">>$outfile;
     echo "# Running in the current working directory">>$outfile;
     echo "#$ -cwd">>$outfile;
     echo "">>$outfile;
     echo "# Export some necessary environment variables">>$outfile;
     echo "#$ -S /bin/bash">>$outfile;
     echo "#$ -v PATH">>$outfile;
     echo "#$ -v LD_LIBRARY_PATH">>$outfile;
     echo "#$ -v PYTHONPATH">>$outfile;
     echo "# Finally, put your command here">>$outfile;
     echo "">>$outfile;
     echo "#$ for i in $files;">>$outfile;
     echo "#$ do;">>$outfile;
     echo "#$ fastqc -f fastq -o /data4/una/test/fastq/$i;">>$outfile;
     echo "#$done">>$outfile;
     echo "">>$outfile;

     qsub $outfile;
done

但是我收到了错误:

Unable to read script file because of error: ERROR! invalid option argument "-f"

但是

fastqc -f fastq -o /data4/una/test/fastq/$i

是我的bash脚本中完全有效的行。

思想?

谢谢!

1 个答案:

答案 0 :(得分:0)

实际上我的循环格式很差导致了这个错误。我根本不需要用token_response = adal.acquire_token_with_client_credentials( 'https://management.core.windows.net/' + '<tenantId>', '<ApplicationId>', '<Application Secret>'开始那些行,所以这些行变为:

#$