Merge pull request #285 from broadinstitute/dr_james_warren_fasta_suffix_bugfix

deducing dictionary path should not use global find and replace
This commit is contained in:
droazen 2013-06-14 16:57:10 -07:00
commit 4151753718
1 changed files with 2 additions and 2 deletions

View File

@ -68,8 +68,8 @@ public class ReferenceDataSource {
final File indexFile = new File(fastaFile.getAbsolutePath() + ".fai");
// determine the name for the dict file
final String fastaExt = fastaFile.getAbsolutePath().endsWith("fa") ? ".fa" : ".fasta";
final File dictFile = new File(fastaFile.getAbsolutePath().replace(fastaExt, ".dict"));
final String fastaExt = fastaFile.getAbsolutePath().endsWith("fa") ? "\\.fa$" : "\\.fasta$";
final File dictFile = new File(fastaFile.getAbsolutePath().replaceAll(fastaExt, ".dict"));
// It's an error if either the fai or dict file does not exist. The user is now responsible
// for creating these files.