VcfResultsWriter implements ResultsWriter { private void writeUnannotatedVariants(ModeOfInheritance modeOfInheritance, AnalysisResults analysisResults, VariantContextWriter writer) { List<VariantContext> updatedRecords = updateGeneVariantRecords(modeOfInheritance, null, analysisResults.getUnAnnotatedVariantEvaluations()); updatedRecords.forEach(writer::add); } VcfResultsWriter(); @Override void writeFile(ModeOfInheritance modeOfInheritance, Analysis analysis, AnalysisResults analysisResults, OutputSettings settings); @Override String writeString(ModeOfInheritance modeOfInheritance, Analysis analysis, AnalysisResults analysisResults, OutputSettings settings);  }
@Test public void testWriteUnannotatedVariants() { VariantEvaluation unAnnotatedVariantEvaluation1 = VariantEvaluation.builder(5, 11, "C", "T") .quality(1) .build(); VariantEvaluation unAnnotatedVariantEvaluation2 = VariantEvaluation.builder(5, 14, "T", "TG") .quality(1) .build(); AnalysisResults analysisResults = AnalysisResults.builder() .variantEvaluations(Arrays.asList(unAnnotatedVariantEvaluation1, unAnnotatedVariantEvaluation2)) .build(); String vcf = instance.writeString(ModeOfInheritance.ANY, analysis, analysisResults, settings); final String expected = EXPECTED_HEADER + "5\t11\t.\tC\tT\t1\t.\tExWarn=VARIANT_NOT_ANALYSED_NO_GENE_ANNOTATIONS\tGT\t0/1\n" + "5\t14\t.\tT\tTG\t1\t.\tExWarn=VARIANT_NOT_ANALYSED_NO_GENE_ANNOTATIONS\tGT\t0/1\n"; assertThat(vcf, equalTo(expected)); }