#!/bin/bash #PBS -e /mnt/lustre/users/USERNAME/blastjobs/blast.stderr.out #PBS -o /mnt/lustre/users/USERNAME/blastjobs/blast.stderr.out #PBS -P PROGRAMMESHORTNAME #PBS -M youremail@address #PBS -l select=4:ncpus=24:nodetype=haswell_reg #PBS -l walltime=00:60:00 #PBS -q normal #PBS -m be cd ${PBS_O_WORKDIR} module add chpc/BIOMODULES module add blast module add gnu-parallel #The module sets the env variable below # and provides the path to the databases #BLASTDB="/mnt/lustre/bsp/DB/BLAST" # To blast against eg, simply use -db nt # To see all databases, "ls $BLASTDB/*.?al" BLASTCMD=$(which blastn) BLASTARGS="-evalue 0.005 -num_alignments 20 -outfmt 5 -num_threads 24 -db nt" INPUTDIRS="DATE/*" ls ${INPUTDIRS}/*.fasta | parallel -M --sshdelay 0.2 -j 1 -u --sshloginfile ${PBS_NODEFILE} "cd ${PBS_O_WORKDIR}; ${BLASTCMD} -query {} ${BLASTARGS} -out {}.xml && gzip --best {} {}.xml"