deducing dictionary path should not use global find and replace

Signed-off-by: David Roazen <droazen@broadinstitute.org>
This commit is contained in:
James Warren 2013-06-14 14:25:16 -07:00 committed by David Roazen
parent 52677429a0
commit f46f7d9b23
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.