From 740b33acbbd9b5e57a92454e4e4a575709d0af82 Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 4 Feb 2014 01:21:17 -0500 Subject: [PATCH] We were never validating the sequence dictionary of tabix indexed VCFs for some reason. Fixed. These changes happened in Tribble, but Joel clobbered them with his commit. We can now change the logging priority on failures to validate the sequence dictionary to WARN. Thanks to Tim F for indirectly pointing this out. --- .../sting/gatk/refdata/tracks/IndexDictionaryUtils.java | 2 +- .../sting/gatk/refdata/tracks/RMDTrackBuilder.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/gatk-framework/src/main/java/org/broadinstitute/sting/gatk/refdata/tracks/IndexDictionaryUtils.java b/public/gatk-framework/src/main/java/org/broadinstitute/sting/gatk/refdata/tracks/IndexDictionaryUtils.java index e0b5dd4cb..fbbaa6636 100644 --- a/public/gatk-framework/src/main/java/org/broadinstitute/sting/gatk/refdata/tracks/IndexDictionaryUtils.java +++ b/public/gatk-framework/src/main/java/org/broadinstitute/sting/gatk/refdata/tracks/IndexDictionaryUtils.java @@ -96,7 +96,7 @@ public class IndexDictionaryUtils { final ValidationExclusion.TYPE validationExclusionType ) { // if the sequence dictionary is empty (as well as null which means it doesn't have a dictionary), skip validation if (trackDict == null || trackDict.size() == 0) - logger.info("Track " + trackName + " doesn't have a sequence dictionary built in, skipping dictionary validation"); + logger.warn("Track " + trackName + " doesn't have a sequence dictionary built in, skipping dictionary validation"); else { Set trackSequences = new TreeSet(); for (SAMSequenceRecord dictionaryEntry : trackDict.getSequences()) diff --git a/public/gatk-framework/src/main/java/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilder.java b/public/gatk-framework/src/main/java/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilder.java index 3433b5342..a587a3984 100644 --- a/public/gatk-framework/src/main/java/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilder.java +++ b/public/gatk-framework/src/main/java/org/broadinstitute/sting/gatk/refdata/tracks/RMDTrackBuilder.java @@ -34,6 +34,7 @@ import org.broad.tribble.TribbleException; import org.broad.tribble.index.Index; import org.broad.tribble.index.IndexFactory; import org.broad.tribble.util.LittleEndianOutputStream; +import org.broad.tribble.util.TabixUtils; import org.broadinstitute.sting.commandline.Tags; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.gatk.arguments.ValidationExclusion; @@ -171,7 +172,9 @@ public class RMDTrackBuilder { // extends PluginManager { // we might not know the index type, try loading with the default reader constructor logger.debug("Attempting to load " + inputFile + " as a tabix indexed file without validating it"); try { - return new Pair(AbstractFeatureReader.getFeatureReader(inputFile.getAbsolutePath(), createCodec(descriptor, name)),null); + final File indexFile = new File(inputFile.getAbsoluteFile() + TabixUtils.STANDARD_INDEX_EXTENSION); + final SAMSequenceDictionary dict = TabixUtils.getSequenceDictionary(indexFile); + return new Pair<>(AbstractFeatureReader.getFeatureReader(inputFile.getAbsolutePath(), createCodec(descriptor, name)), dict); } catch (TribbleException e) { throw new UserException(e.getMessage(), e); }