diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/SelfScopingFeatureCodec.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/SelfScopingFeatureCodec.java deleted file mode 100644 index de781b839..000000000 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/SelfScopingFeatureCodec.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2011, The Broad Institute - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package org.broadinstitute.sting.gatk.refdata; - -import java.io.File; - -/** - * An interface marking that a given Tribble codec can look at the file and determine whether the - * codec specifically parsing the contents of the file. - */ -public interface SelfScopingFeatureCodec { - /** - * This function returns true iff the File potentialInput can be parsed by this - * codec. - * - * The GATK assumes that there's never a situation where two SelfScopingFeaetureCodecs - * return true for the same file. If this occurs the GATK splits out an error. - * - * Note this function must never throw an error. All errors should be trapped - * and false returned. - * - * @param potentialInput the file to test for parsiability with this codec - * @return true if potentialInput can be parsed, false otherwise - */ - public boolean canDecode(final File potentialInput); -} diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/FeatureManager.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/FeatureManager.java index c99aea254..c41444ef3 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/FeatureManager.java +++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/tracks/FeatureManager.java @@ -30,16 +30,12 @@ import org.broad.tribble.Feature; import org.broad.tribble.FeatureCodec; import org.broad.tribble.NameAwareCodec; import org.broadinstitute.sting.gatk.refdata.ReferenceDependentFeatureCodec; -import org.broadinstitute.sting.gatk.refdata.SelfScopingFeatureCodec; import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet; import org.broadinstitute.sting.utils.GenomeLocParser; -import org.broadinstitute.sting.utils.Utils; import org.broadinstitute.sting.utils.classloader.PluginManager; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.help.GATKDocUtils; -import org.broadinstitute.sting.utils.help.HelpUtils; -import javax.mail.Header; import java.io.File; import java.util.*; @@ -159,10 +155,8 @@ public class FeatureManager { public FeatureDescriptor getByFiletype(File file) { List canParse = new ArrayList(); for ( FeatureDescriptor descriptor : featureDescriptors ) - if ( descriptor.getCodec() instanceof SelfScopingFeatureCodec ) { - if ( ((SelfScopingFeatureCodec) descriptor.getCodec()).canDecode(file) ) { - canParse.add(descriptor); - } + if ( descriptor.getCodec().canDecode(file) ) { + canParse.add(descriptor); } if ( canParse.size() == 0 ) diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/beagle/BeagleCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/beagle/BeagleCodec.java index 413848543..90d305d73 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/beagle/BeagleCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/beagle/BeagleCodec.java @@ -249,4 +249,6 @@ public class BeagleCodec implements ReferenceDependentFeatureCodec getFeatureType() { return RefSeqFeature.class; } + + public boolean canDecode(final File potentialInput) { return false; } + } diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/sampileup/SAMPileupCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/sampileup/SAMPileupCodec.java index f4633b2ce..d9f16c353 100644 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/sampileup/SAMPileupCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/sampileup/SAMPileupCodec.java @@ -25,8 +25,8 @@ package org.broadinstitute.sting.utils.codecs.sampileup; +import org.broad.tribble.AbstractFeatureCodec; import org.broad.tribble.Feature; -import org.broad.tribble.FeatureCodec; import org.broad.tribble.exception.CodecLineParsingException; import org.broad.tribble.readers.LineReader; import org.broad.tribble.util.ParsingUtils; @@ -76,7 +76,7 @@ import static org.broadinstitute.sting.utils.codecs.sampileup.SAMPileupFeature.V * @author Matt Hanna * @since 2009 */ -public class SAMPileupCodec implements FeatureCodec { +public class SAMPileupCodec extends AbstractFeatureCodec { // the number of tokens we expect to parse from a pileup line private static final int expectedTokenCount = 10; private static final char fldDelim = '\t'; diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/samread/SAMReadCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/samread/SAMReadCodec.java index d4bdb5aa9..0f2b94e63 100644 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/samread/SAMReadCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/samread/SAMReadCodec.java @@ -27,8 +27,8 @@ package org.broadinstitute.sting.utils.codecs.samread; import net.sf.samtools.Cigar; import net.sf.samtools.TextCigarCodec; import net.sf.samtools.util.StringUtil; +import org.broad.tribble.AbstractFeatureCodec; import org.broad.tribble.Feature; -import org.broad.tribble.FeatureCodec; import org.broad.tribble.exception.CodecLineParsingException; import org.broad.tribble.readers.LineReader; import org.broad.tribble.util.ParsingUtils; @@ -52,7 +52,7 @@ import org.broad.tribble.util.ParsingUtils; * @author Matt Hanna * @since 2009 */ -public class SAMReadCodec implements FeatureCodec { +public class SAMReadCodec extends AbstractFeatureCodec { /* SL-XBC:1:10:628:923#0 16 Escherichia_coli_K12 1 37 76M = 1 0 AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGCTTCTGA B@>87<;A@?@957:>>@AA@B>@A9AB@B>@A@@@@@A;=AAB@BBBBBCBBBB@>A>:ABB@BAABCB=CA@CB */ // the number of tokens we expect to parse from a read line diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/table/TableCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/table/TableCodec.java index 1919ccbf0..97c15fbb8 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/table/TableCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/table/TableCodec.java @@ -6,6 +6,7 @@ import org.broadinstitute.sting.gatk.refdata.ReferenceDependentFeatureCodec; import org.broadinstitute.sting.utils.GenomeLocParser; import org.broadinstitute.sting.utils.exceptions.UserException; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -101,4 +102,7 @@ public class TableCodec implements ReferenceDependentFeatureCodec { } return header; } + + public boolean canDecode(final File potentialInput) { return false; } + } diff --git a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java index 0e0cb14bf..3377172dd 100755 --- a/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java +++ b/public/java/src/org/broadinstitute/sting/utils/codecs/vcf/AbstractVCFCodec.java @@ -8,7 +8,6 @@ import org.broad.tribble.TribbleException; import org.broad.tribble.readers.LineReader; import org.broad.tribble.util.BlockCompressedInputStream; import org.broad.tribble.util.ParsingUtils; -import org.broadinstitute.sting.gatk.refdata.SelfScopingFeatureCodec; import org.broadinstitute.sting.utils.exceptions.ReviewedStingException; import org.broadinstitute.sting.utils.exceptions.UserException; import org.broadinstitute.sting.utils.variantcontext.Allele; @@ -20,7 +19,7 @@ import java.util.*; import java.util.zip.GZIPInputStream; -public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec, VCFParser, SelfScopingFeatureCodec { +public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec, VCFParser { protected final static Logger log = Logger.getLogger(VCFCodec.class); protected final static int NUM_STANDARD_FIELDS = 8; // INFO is the 8th column diff --git a/settings/repository/org.broad/tribble-40.jar b/settings/repository/org.broad/tribble-41.jar similarity index 92% rename from settings/repository/org.broad/tribble-40.jar rename to settings/repository/org.broad/tribble-41.jar index 7f68b4b36..76903f007 100644 Binary files a/settings/repository/org.broad/tribble-40.jar and b/settings/repository/org.broad/tribble-41.jar differ diff --git a/settings/repository/org.broad/tribble-40.xml b/settings/repository/org.broad/tribble-41.xml similarity index 51% rename from settings/repository/org.broad/tribble-40.xml rename to settings/repository/org.broad/tribble-41.xml index 6a01b3790..6ee8bfb78 100644 --- a/settings/repository/org.broad/tribble-40.xml +++ b/settings/repository/org.broad/tribble-41.xml @@ -1,3 +1,3 @@ - +