use of htsjdk.variant.variantcontext.writer.VariantContextWriter in project gatk by broadinstitute.
the class GVCFWriterUnitTest method writeGVCFToDisk.
@Test(dataProvider = "toWriteToDisk")
public void writeGVCFToDisk(List<VariantContext> variants, List<MinimalData> expected) {
final List<Integer> gqPartitions = Arrays.asList(1, 10, 30);
final File outputFile = createTempFile("generated", ".g.vcf");
try (VariantContextWriter writer = GATKVariantContextUtils.createVCFWriter(outputFile, null, false);
GVCFWriter gvcfWriter = new GVCFWriter(writer, gqPartitions, HomoSapiensConstants.DEFAULT_PLOIDY)) {
gvcfWriter.writeHeader(getMinimalVCFHeader());
variants.forEach(gvcfWriter::add);
}
assertGVCFIsParseableAndVariantsMatch(outputFile, expected);
}
Aggregations