Finished with the tophat SGE script as well as adding quotes around variables in if statements to make sure condition is evaluated as a whole string.