Search in sources :

Example 1 with Feature

use of htsjdk.tribble.Feature in project gatk by broadinstitute.

the class FeatureInputUnitTest method testToString.

@Test
public void testToString() {
    final FeatureInput<Feature> namelessFeatureInput = new FeatureInput<>("file1");
    final FeatureInput<Feature> namedFeatureInput = new FeatureInput<>("name:file1");
    final FeatureInput<Feature> namelessGenomicsDB = new FeatureInput<>("gendb://file1");
    final FeatureInput<Feature> namedGenomicsDB = new FeatureInput<>("name:gendb://file1");
    Assert.assertEquals(namelessFeatureInput.toString(), new File("file1").getAbsolutePath(), "String representation of nameless FeatureInput incorrect");
    Assert.assertEquals(namedFeatureInput.toString(), "name:" + new File("file1").getAbsolutePath(), "String representation of named FeatureInput incorrect");
    Assert.assertEquals(namelessGenomicsDB.toString(), "gendb://" + new File("file1").getAbsolutePath(), "String representation of nameless FeatureInput with genomicsDB path incorrect");
    Assert.assertEquals(namedGenomicsDB.toString(), "name:gendb://" + new File("file1").getAbsolutePath(), "String representation of named FeatureInput with genomicsDB path incorrect");
}
Also used : Feature(htsjdk.tribble.Feature) File(java.io.File) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 2 with Feature

use of htsjdk.tribble.Feature in project gatk by broadinstitute.

the class ProgressReportingDelegatingCodec method decodeLoc.

@Override
public Feature decodeLoc(final B b) throws IOException {
    if (delegatee == null) {
        throw new IllegalStateException("this codec cannot be used without a delegatee.");
    }
    if (!pm.started()) {
        pm.start();
    }
    final Feature f = delegatee.decodeLoc(b);
    pm.update(f);
    return f;
}
Also used : Feature(htsjdk.tribble.Feature)

Example 3 with Feature

use of htsjdk.tribble.Feature in project gatk by broadinstitute.

the class SAMPileupCodecUnitTest method testDecodeLoc.

@Test(dataProvider = "stringFeature")
private void testDecodeLoc(final String pileupString, final SAMPileupFeature expected) throws Exception {
    final Feature feature = CODEC.decodeLoc(new LineIteratorImpl(makeReader(pileupString)));
    Assert.assertEquals(feature.getContig(), expected.getContig());
    Assert.assertEquals(feature.getStart(), expected.getStart());
    Assert.assertEquals(feature.getEnd(), expected.getEnd());
}
Also used : LineIteratorImpl(htsjdk.tribble.readers.LineIteratorImpl) Feature(htsjdk.tribble.Feature) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Example 4 with Feature

use of htsjdk.tribble.Feature in project gatk by broadinstitute.

the class GenomeLocParserUnitTest method testCreationFromFeature.

@Test
public void testCreationFromFeature() {
    final Feature feature = new SimpleFeature("1", 1, 5);
    final GenomeLoc loc = genomeLocParser.createGenomeLoc(feature);
    Assert.assertEquals(loc.getContig(), feature.getContig());
    Assert.assertEquals(loc.getStart(), feature.getStart());
    Assert.assertEquals(loc.getStop(), feature.getEnd());
}
Also used : SimpleFeature(htsjdk.tribble.SimpleFeature) Feature(htsjdk.tribble.Feature) SimpleFeature(htsjdk.tribble.SimpleFeature) BaseTest(org.broadinstitute.hellbender.utils.test.BaseTest) Test(org.testng.annotations.Test)

Aggregations

Feature (htsjdk.tribble.Feature)4 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)3 Test (org.testng.annotations.Test)3 SimpleFeature (htsjdk.tribble.SimpleFeature)1 LineIteratorImpl (htsjdk.tribble.readers.LineIteratorImpl)1 File (java.io.File)1