Tribble v42 changes the Codec.canDecode method to take in a String instead of a File; this is something that Jim was adamant about (because Tribble can handle streams other than files). I didn't want the next person who needed to rev Tribble to deal with this change additionally, so I took care of updating the GATK now.
This commit is contained in:
parent
436b4dc855
commit
d7d8b8e380
|
|
@ -155,7 +155,7 @@ public class FeatureManager {
|
|||
public FeatureDescriptor getByFiletype(File file) {
|
||||
List<FeatureDescriptor> canParse = new ArrayList<FeatureDescriptor>();
|
||||
for ( FeatureDescriptor descriptor : featureDescriptors )
|
||||
if ( descriptor.getCodec().canDecode(file) ) {
|
||||
if ( descriptor.getCodec().canDecode(file.getPath()) ) {
|
||||
canParse.add(descriptor);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import org.broadinstitute.sting.utils.variantcontext.VariantContext;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -135,6 +134,6 @@ public class VCFDiffableReader implements DiffableReader {
|
|||
|
||||
@Override
|
||||
public boolean canRead(File file) {
|
||||
return AbstractVCFCodec.canDecodeFile(file, VCFCodec.VCF4_MAGIC_HEADER);
|
||||
return AbstractVCFCodec.canDecodeFile(file.getPath(), VCFCodec.VCF4_MAGIC_HEADER);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,6 +249,6 @@ public class BeagleCodec implements ReferenceDependentFeatureCodec<BeagleFeature
|
|||
return bglFeature;
|
||||
}
|
||||
|
||||
public boolean canDecode(final File potentialInput) { return false; }
|
||||
public boolean canDecode(final String potentialInput) { return false; }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import org.broadinstitute.sting.utils.GenomeLocParser;
|
|||
import org.broadinstitute.sting.utils.Utils;
|
||||
import org.broadinstitute.sting.utils.exceptions.UserException;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
|
|
@ -140,6 +139,6 @@ public class RefSeqCodec implements ReferenceDependentFeatureCodec<RefSeqFeature
|
|||
return RefSeqFeature.class;
|
||||
}
|
||||
|
||||
public boolean canDecode(final File potentialInput) { return false; }
|
||||
public boolean canDecode(final String potentialInput) { return false; }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ 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;
|
||||
|
|
@ -109,6 +108,6 @@ public class TableCodec implements ReferenceDependentFeatureCodec {
|
|||
return header;
|
||||
}
|
||||
|
||||
public boolean canDecode(final File potentialInput) { return false; }
|
||||
public boolean canDecode(final String potentialInput) { return false; }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -638,7 +638,7 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec {
|
|||
return position+Math.max(refLength - 1,0);
|
||||
}
|
||||
|
||||
public final static boolean canDecodeFile(final File potentialInput, final String MAGIC_HEADER_LINE) {
|
||||
public final static boolean canDecodeFile(final String potentialInput, final String MAGIC_HEADER_LINE) {
|
||||
try {
|
||||
return isVCFStream(new FileInputStream(potentialInput), MAGIC_HEADER_LINE) ||
|
||||
isVCFStream(new GZIPInputStream(new FileInputStream(potentialInput)), MAGIC_HEADER_LINE) ||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import org.broad.tribble.readers.LineReader;
|
|||
import org.broad.tribble.util.ParsingUtils;
|
||||
import org.broadinstitute.sting.utils.variantcontext.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -193,7 +192,7 @@ public class VCF3Codec extends AbstractVCFCodec {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canDecode(final File potentialInput) {
|
||||
public boolean canDecode(final String potentialInput) {
|
||||
return canDecodeFile(potentialInput, VCF3_MAGIC_HEADER);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import org.broad.tribble.readers.LineReader;
|
|||
import org.broad.tribble.util.ParsingUtils;
|
||||
import org.broadinstitute.sting.utils.variantcontext.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -217,7 +216,7 @@ public class VCFCodec extends AbstractVCFCodec {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canDecode(final File potentialInput) {
|
||||
public boolean canDecode(final String potentialInput) {
|
||||
return canDecodeFile(potentialInput, VCF4_MAGIC_HEADER);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,3 +1,3 @@
|
|||
<ivy-module version="1.0">
|
||||
<info organisation="org.broad" module="tribble" revision="41" status="integration" />
|
||||
<info organisation="org.broad" module="tribble" revision="42" status="integration" />
|
||||
</ivy-module>
|
||||
Loading…
Reference in New Issue