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");
}
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;
}
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());
}
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());
}
Aggregations