use of org.broadinstitute.hellbender.engine.datasources.ReferenceAPISource in project gatk by broadinstitute.
the class ReferenceAPISourceUnitTest method testSequenceDictionarySorting.
@Test(dataProvider = "sortData")
public void testSequenceDictionarySorting(String inputs, String outputs) {
final String[] input = inputs.split(",");
final String[] expected = outputs.split(",");
final ReferenceAPISource ref = new ReferenceAPISource(createDummyReferenceMap(input));
final SAMSequenceDictionary seq = ref.getReferenceSequenceDictionary(null);
checkSequenceDictionary(seq, expected);
}
use of org.broadinstitute.hellbender.engine.datasources.ReferenceAPISource in project gatk by broadinstitute.
the class ReferenceAPISourceUnitTest method queryReferenceAPI.
private ReferenceBases queryReferenceAPI(final String referenceName, final SimpleInterval interval, int pageSize) {
final Pipeline p = setupPipeline();
ReferenceAPISource refAPISource = makeReferenceAPISource(referenceName, p);
return refAPISource.getReferenceBases(p.getOptions(), interval, pageSize);
}
use of org.broadinstitute.hellbender.engine.datasources.ReferenceAPISource in project gatk by broadinstitute.
the class ReferenceAPISourceUnitTest method testCreateByAssemblyID.
@Test(groups = "cloud", dataProvider = "assemblyIDData")
public void testCreateByAssemblyID(final String assemblyID, final String refID) throws Exception {
final Pipeline p = setupPipeline();
final ReferenceAPISource apiSourceByAssemblyName = ReferenceAPISource.fromReferenceSetAssemblyID(p.getOptions(), assemblyID);
final ReferenceAPISource apiSourceByID = makeReferenceAPISource(refID, p);
Assert.assertEquals(apiSourceByAssemblyName.getReferenceMap(), apiSourceByID.getReferenceMap());
}
use of org.broadinstitute.hellbender.engine.datasources.ReferenceAPISource in project gatk by broadinstitute.
the class ReferenceAPISourceUnitTest method testDummy.
@Test(groups = "cloud")
public void testDummy() {
String referenceName = HS37D5_REF_ID;
final String expected = "AAACAGGTTA";
// -1 because we're using closed intervals
SimpleInterval interval = new SimpleInterval("1", 50001, 50001 + expected.length() - 1);
Logger logger = LogManager.getLogger(ReferenceAPISourceUnitTest.class);
GenomicsOptions options = PipelineOptionsFactory.create().as(GenomicsOptions.class);
options.setApiKey(getGCPTestApiKey());
options.setProject(getGCPTestProject());
// We don't use GATKTestPipeline because we need specific options.
final Pipeline p = TestPipeline.create(options);
ReferenceAPISource refAPISource = makeReferenceAPISource(referenceName, p);
ReferenceBases bases = refAPISource.getReferenceBases(p.getOptions(), interval);
final String actual = new String(bases.getBases());
Assert.assertEquals(actual, expected, "Wrong bases returned");
p.run();
}
use of org.broadinstitute.hellbender.engine.datasources.ReferenceAPISource in project gatk by broadinstitute.
the class ReferenceAPISourceUnitTest method testCreateByAssemblyIDMultipleReferenceSets.
@Test(groups = "cloud", dataProvider = "assemblyIDDataMultiple", expectedExceptions = UserException.MultipleReferenceSets.class)
public void testCreateByAssemblyIDMultipleReferenceSets(final String assemblyID, final String refID) throws Exception {
final Pipeline p = setupPipeline();
final ReferenceAPISource apiSourceByAssemblyName = ReferenceAPISource.fromReferenceSetAssemblyID(p.getOptions(), assemblyID);
final ReferenceAPISource apiSourceByID = makeReferenceAPISource(refID, p);
Assert.assertEquals(apiSourceByAssemblyName.getReferenceMap(), apiSourceByID.getReferenceMap());
}
Aggregations