diff --git a/java/src/org/broadinstitute/sting/gatk/executive/MicroScheduler.java b/java/src/org/broadinstitute/sting/gatk/executive/MicroScheduler.java index 3eee8c22b..8336007e9 100755 --- a/java/src/org/broadinstitute/sting/gatk/executive/MicroScheduler.java +++ b/java/src/org/broadinstitute/sting/gatk/executive/MicroScheduler.java @@ -196,7 +196,7 @@ public abstract class MicroScheduler { ref = new IndexedFastaSequenceFile(refFile); } catch (FileNotFoundException ex) { - throw new RuntimeException("File not found opening fasta file; please do this check before MicroManaging", ex); + throw new StingException("I/O error while opening fasta file: " + ex.getMessage(), ex); } GenomeLoc.setupRefContigOrdering(ref); return ref; diff --git a/java/src/org/broadinstitute/sting/utils/fasta/FastaSequenceIndex.java b/java/src/org/broadinstitute/sting/utils/fasta/FastaSequenceIndex.java index 80643e06d..490826c86 100755 --- a/java/src/org/broadinstitute/sting/utils/fasta/FastaSequenceIndex.java +++ b/java/src/org/broadinstitute/sting/utils/fasta/FastaSequenceIndex.java @@ -31,7 +31,7 @@ public class FastaSequenceIndex implements Iterable { */ public FastaSequenceIndex( File indexFile ) throws FileNotFoundException { if(!indexFile.exists()) - throw new FileNotFoundException("Index file is missing"); + throw new FileNotFoundException(String.format("Fasta index file is missing",indexFile.getAbsolutePath())); IoUtil.assertFileIsReadable(indexFile); parseIndexFile(indexFile); diff --git a/java/src/org/broadinstitute/sting/utils/fasta/IndexedFastaSequenceFile.java b/java/src/org/broadinstitute/sting/utils/fasta/IndexedFastaSequenceFile.java index 026a60cfc..d1a426e3f 100755 --- a/java/src/org/broadinstitute/sting/utils/fasta/IndexedFastaSequenceFile.java +++ b/java/src/org/broadinstitute/sting/utils/fasta/IndexedFastaSequenceFile.java @@ -90,6 +90,9 @@ public class IndexedFastaSequenceFile implements ReferenceSequenceFile { */ private void loadIndex( File fastaFile ) throws FileNotFoundException { File indexFile = new File(fastaFile.getAbsolutePath() + ".fai"); + if (!indexFile.exists()) + throw new PicardException(String.format("Unable to load fasta index file %s. "+ + "Please create it using 'samtools faidx'.",indexFile.getAbsolutePath())); index = new FastaSequenceIndex(indexFile); indexIterator = index.iterator(); }