Better error checking for missing .dict file.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@741 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2009-05-17 21:57:12 +00:00
parent 7161b8f927
commit d35e20ce21
1 changed files with 12 additions and 11 deletions

View File

@ -67,7 +67,9 @@ public class IndexedFastaSequenceFile implements ReferenceSequenceFile {
dictionaryName = dictionaryName.substring(0, dictionaryName.lastIndexOf(".fasta")); dictionaryName = dictionaryName.substring(0, dictionaryName.lastIndexOf(".fasta"));
dictionaryName += ".dict"; dictionaryName += ".dict";
final File dictionary = new File(dictionaryName); final File dictionary = new File(dictionaryName);
if (dictionary.exists()) { if (!dictionary.exists())
throw new PicardException("Unable to load .dict file. Dictionary is required for the indexed fasta reader.");
IoUtil.assertFileIsReadable(dictionary); IoUtil.assertFileIsReadable(dictionary);
try { try {
@ -80,7 +82,6 @@ public class IndexedFastaSequenceFile implements ReferenceSequenceFile {
catch (Exception e) { catch (Exception e) {
throw new PicardException("Could not open sequence dictionary file: " + dictionaryName, e); throw new PicardException("Could not open sequence dictionary file: " + dictionaryName, e);
} }
}
} }