diff --git a/src/main/java/com/github/discvrseq/walkers/AnnotateNovelSites.java b/src/main/java/com/github/discvrseq/walkers/AnnotateNovelSites.java index bb430097..0441f937 100644 --- a/src/main/java/com/github/discvrseq/walkers/AnnotateNovelSites.java +++ b/src/main/java/com/github/discvrseq/walkers/AnnotateNovelSites.java @@ -127,10 +127,10 @@ public void apply(List variantContexts, ReferenceContext referen // Site is novel: if (refVariants == null || refVariants.isEmpty()) { vcb.attribute(novelSiteAnnotationName, novelSiteAnnotationValue); + novelSites++; writer.add(vcb.make()); if (novelSitesWriter != null) { - novelSites++; novelSitesWriter.add(vcb.genotypes().make()); } } @@ -162,13 +162,13 @@ public void apply(List variantContexts, ReferenceContext referen if (!foundMatchingRef) { vcb.attribute(novelSiteAnnotationName, novelSiteAnnotationValue); isNovel = true; + novelSites++; } vc = vcb.make(); writer.add(vc); if (isNovel && novelSitesWriter != null) { - novelSites++; novelSitesWriter.add(vcb.genotypes().make()); } }