SnpEffCodec now implements SelfScopingFeatureCodec so that we no longer have to specify the codec name on the command line for SnpEff files.
This commit is contained in:
parent
577f861f69
commit
0497170bc9
|
|
@ -27,11 +27,16 @@ package org.broadinstitute.sting.utils.codecs.snpEff;
|
|||
import org.broad.tribble.Feature;
|
||||
import org.broad.tribble.FeatureCodec;
|
||||
import org.broad.tribble.TribbleException;
|
||||
import org.broad.tribble.readers.AsciiLineReader;
|
||||
import org.broad.tribble.readers.LineReader;
|
||||
import org.broadinstitute.sting.gatk.refdata.SelfScopingFeatureCodec;
|
||||
|
||||
import static org.broadinstitute.sting.utils.codecs.snpEff.SnpEffConstants.EffectType;
|
||||
import static org.broadinstitute.sting.utils.codecs.snpEff.SnpEffConstants.ChangeType;
|
||||
import static org.broadinstitute.sting.utils.codecs.snpEff.SnpEffConstants.Zygosity;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
|
@ -68,7 +73,7 @@ import java.io.IOException;
|
|||
*
|
||||
* @author David Roazen
|
||||
*/
|
||||
public class SnpEffCodec implements FeatureCodec {
|
||||
public class SnpEffCodec implements FeatureCodec, SelfScopingFeatureCodec {
|
||||
|
||||
public static final int EXPECTED_NUMBER_OF_FIELDS = 23;
|
||||
public static final String FIELD_DELIMITER_PATTERN = "\\t";
|
||||
|
|
@ -255,4 +260,16 @@ public class SnpEffCodec implements FeatureCodec {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canDecode ( final File potentialInput ) {
|
||||
try {
|
||||
LineReader reader = new AsciiLineReader(new FileInputStream(potentialInput));
|
||||
readHeader(reader);
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,8 +129,8 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest {
|
|||
@Test
|
||||
public void testSnpEffAnnotations() {
|
||||
WalkerTestSpec spec = new WalkerTestSpec(
|
||||
"-T VariantAnnotator -R " + b37KGReference + " -NO_HEADER -o %s -A SnpEff --variant:VCF " +
|
||||
validationDataLocation + "1000G.exomes.vcf --snpEffFile:SnpEff " + validationDataLocation +
|
||||
"-T VariantAnnotator -R " + b37KGReference + " -NO_HEADER -o %s -A SnpEff --variant " +
|
||||
validationDataLocation + "1000G.exomes.vcf --snpEffFile " + validationDataLocation +
|
||||
"snpEff_1.9.6_1000G.exomes.vcf_hg37.61.out -L 1:26,000,000-26,500,000",
|
||||
1,
|
||||
Arrays.asList("c08648a078368c80530bff004b3157f1")
|
||||
|
|
|
|||
Loading…
Reference in New Issue