#!/bin/bash source $HOME/.bashrc module load biotools echo "CIPRES_THREADSPP=$CIPRES_THREADSPP" echo "CIPRES_NP=$CIPRES_NP" echo "running: blastn $*" # 1 gigabyte # (( maxsize = (1024 * 1024 * 1024) )) # Maxsize should be 1 so that we never return blast_output.txt but I changed # it temporarily to 20meg so that Jim can get and check blast_output.txt for debugging # maxsize=1 maxsize=20971520 blastn $* && blast_parser.pl blast_output.txt > blast_output_hits.txt # blast_parser.pl blast_output.txt > blast_output_hits.txt if [[ -s blast_output_hits.txt ]] ; then echo "Parsed blast hits are in blast_output_hits.txt" size=$(stat -c %s blast_output.txt) if [[ $size -gt $maxsize ]] ; then echo "Removing blast alignments, blast_output.txt, because file size of $size > max allowed size of $maxsize" rm blast_output.txt fi fi