bgruening/galaxytools — pull request #37 by nsoranzo (2014-03-06 13:21:05+00:00)
Title: Fix for missing .fai and .dict when using reference file from the history

When selecting the FASTA reference file from the history, GATK 2.8 and
later (and maybe earlier versions too) does not create '.fai' and '.dict'
anymore:

```ERROR MESSAGE: Fasta index file /opt/galaxy/tmp/tmp-gatk-Obym0N/gatk_input.fasta.fai for reference /opt/galaxy/tmp/tmp-gatk-Obym0N/gatk_input.fasta does not exist. Please see http://gatkforums.broadinstitute.org/discussion/1601/how-can-i-prepare-a-fasta-file-to-use-as-reference for help creating it.```

Similar error if only the .fai, but not the .dict is created:

```ERROR MESSAGE: Fasta dict file /opt/galaxy/tmp/tmp-gatk-vlrnAe/gatk_input.dict for reference /opt/galaxy/tmp/tmp-gatk-vlrnAe/gatk_input.fasta does not exist. Please see http://gatkforums.broadinstitute.org/discussion/1601/how-can-i-prepare-a-fasta-file-to-use-as-reference for help creating it.```

This commit also centralize the removal of tmp_dir using try/finally.